API
1. constructor()
-
config
env
const dalsh = new Dalsh({
env: {
PATH: <path array to prepend>
}
})
2. request()
await dalsh.request(req, callback)
-
req
: request object-
on
: globally monitor events at any time -
sequence
: monitor events in a certain sequence. -
message
: command -
path
: execution path
-
-
callback
: streams data from the terminal in realtime
Example
let response = await dalsh.request({
message: "dls -las",
on: {
},
sequence: {
},
}, (stream) => {
console.log(stream)
})
3. prompt()
get the prompt
await dalsh.prompt()