npm.io
2.0.0 • Published 2 years agoCLI

instant-replay

Licence
MIT
Version
2.0.0
Deps
1
Size
5 kB
Vulns
0
Weekly
0

Instant REPLay

REPL playground, built instantly from your dependencies


Usage

Command

$ node_modules/.bin/replay [options]
Script

package.json

{
  "scripts": {
    "replay": "replay [options]"
  },
  "dependencies": {
    "faker": "^4.1.0",
    "lodash": "^4.17.12"
  }
}
NPM
$ npm run replay
Yarn
$ yarn replay
Options
Option Alias Description
--version -v Show version number.
--help -h Show help.
--output -o Specify output file, such as replay -o "./path/to/file.js". The default is ./bin/repl.js.
REPL
Run REPL
$ node ./bin/repl.js
>
See available dependencies
> deps
[ 'faker', 'lodash' ]
>
See available devDependencies
> devDeps
[ '' ]
>
Load dependency
> load('faker')
'+faker'
> faker.name.firstName()
'Jake'
>
Load dependency with alias
> load('lodash', '_')
'+_'
> _.add(1, 2)
3
> lodash.add(1, 2)
Thrown:
ReferenceError: lodash is not defined
>
Load Node modules
> load('fs')
'+fs'
> load('path')
'+path'
>
Unload dependencies/modules
> unload('faker', '_', 'fs', 'path')
'-faker, -_, -fs, -path'
>
Exit REPL
> exit
$

or

> quit
$

Installation

NPM
$ npm i -D instant-replay
Yarn
$ yarn add -D instant-replay

Keywords