2.0.1 • Published 9 days ago

bare-repl v2.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
9 days ago

bare-repl

Read-Evaluate-Print-Loop environment for JavaScript.

npm i bare-repl

Usage

const { start } = require('bare-repl')
const repl = start()

API

const repl = start([options])

Options include:

{
  prompt: string, // sets repl prompt
  useColors: boolean, // toogles ANSI style codes to colorize the output
  writer: (message) => message, // converts repl output
  input: stream, // sets repl input stream
  output: stream, // sets repl output stream
  eval: (cmd) => {} // sets eval function
}

repl.defineCommand(keyword, { help, action })

Define a repl command keyword.

repl.defineCommand('greet, { help: 'Greetings', action: () => console.log('hello') })
bare-repl
> .greet
hello

repl.context

Set execution context.

repl.context.f = () => console.log('Hello from context')
bare-repl
> f()
Hello from context

License

Apache-2.0

2.0.1

9 days ago

2.0.0

17 days ago

1.0.6

1 month ago

1.0.5

1 month ago

1.0.4

2 months ago

1.0.3

3 months ago

1.0.2

3 months ago

1.0.1

3 months ago

1.0.0

3 months ago

0.6.1

3 months ago

0.6.0

3 months ago

0.3.0

9 months ago

0.5.0

6 months ago

0.4.1

7 months ago

0.3.2

8 months ago

0.4.0

8 months ago

0.3.1

9 months ago

0.5.1

6 months ago

0.2.0

11 months ago

0.1.8

11 months ago

0.1.9

11 months ago

0.1.0

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.0.2

11 months ago

0.1.7

11 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.6

11 months ago

0.1.5

11 months ago

0.0.1

12 months ago

0.0.0

12 months ago