https://github.com/bttmly/ish
inject scripts into a node REPL
https://github.com/bttmly/ish
Last synced: about 2 months ago
JSON representation
inject scripts into a node REPL
- Host: GitHub
- URL: https://github.com/bttmly/ish
- Owner: bttmly
- License: mit
- Created: 2015-02-26T01:49:04.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-04-11T05:49:23.000Z (almost 11 years ago)
- Last Synced: 2025-01-08T22:01:19.922Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 734 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ish [](https://travis-ci.org/nickb1080/ish)
Install it globally
```
npm i -g ish
```
Choose some files, run them, and inject their `module.exports` properties into the global scope of a new REPL.
There are probably some lingering edge cases around properly resolving file paths depending on whether the caller is `bin/ish` or another script.
Given a file with CommonJS exports...
```
// my-module.js
module.exports = "some value";
```
Then, from the command line...
```
> ish myModule=./my-module.js
$ console.log(myModule)
"some value"
```
It's basically the same as opening a Node REPL and requiring the module, except it can do a couple extra things:
- Automatically compile CoffeeScript
- Compile ES6 JavaScript with the `--babel` flag
- Inject exported properties into scope under their property names
- Access top level private variables of a module
Docs on using these settings coming soon.