REPL playground, built instantly from your dependencies
$ node_modules/.bin/replay [options]
package.json
{
"scripts": {
"replay": "replay [options]"
},
"dependencies": {
"faker": "^4.1.0",
"lodash": "^4.17.12"
}
}
$ npm run replay
$ yarn replay
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 . |
$ node ./bin/repl.js
>
> deps
[ 'faker', 'lodash' ]
>
> devDeps
[ '' ]
>
> load('faker')
'+faker'
> faker.name.firstName()
'Jake'
>
> load('lodash', '_')
'+_'
> _.add(1, 2)
3
> lodash.add(1, 2)
Thrown:
ReferenceError: lodash is not defined
>
> load('fs')
'+fs'
> load('path')
'+path'
>
> unload('faker', '_', 'fs', 'path')
'-faker, -_, -fs, -path'
>
> exit
$
or
> quit
$
$ npm i -D instant-replay
$ yarn add -D instant-replay