0.15.0
https://github.com/nushell/reedline/ ffi deno wrapper
Attributes
Includes Deno configuration
Repository
Current version released
2 years ago
Dependencies
deno.land/x
Reedline Deno
https://github.com/nushell/reedline/ deno ffi wrapper
Usage
- This library requires
--unstable
flag
import { ReedLine } from "https://deno.land/x/reedline_deno@0.14.0/src/mod.ts";
const rl = await ReedLine.create();
while (true) {
const line = await rl.readLine({
render_prompt_left: "> ",
render_prompt_right: "<",
});
if (line.signal === "CtrlC") {
console.log("CtrlC");
break;
}
if (line.signal === "CtrlD") {
console.log("CtrlD");
break;
}
console.log(line.value);
}
import {} from "https://deno.land/x/reedline_deno@0.14.0/src/extra.ts";
const answer = await rl.question("What's up?", {
render_prompt_left: "??> ",
render_prompt_right: "<#",
});
console.log("You are: ", answer.value);
Development
workflow:
deno task example
should be used to test changes.
design:
- Try to mimic https://docs.rs/reedline/latest/reedline api as best as typescript allows.
- Apis that don’t exist in reedline should go to
src/extra.ts
. (for exampleReedLine.question
)