4.0.0 • Published 7 months ago

bare-repl v4.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 months 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

4.0.0

7 months ago

3.0.2

8 months ago

2.0.5

10 months ago

2.0.7

9 months ago

2.0.6

10 months ago

2.0.8

9 months ago

3.0.1

9 months ago

3.0.0

9 months ago

2.0.4

10 months ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.3.0

2 years ago

0.5.0

2 years ago

0.4.1

2 years ago

0.3.2

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.5.1

2 years ago

0.2.0

2 years ago

0.1.8

2 years ago

0.1.9

2 years ago

0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.0.2

2 years ago

0.1.7

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago