Skip to content

Commit 15ae87b

Browse files
committed
doc: add README usage guide
1 parent 00e6f8e commit 15ae87b

3 files changed

Lines changed: 33 additions & 5 deletions

File tree

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,31 @@ appropriate for the language of the script, ex. `coffee`).
2121

2222
This package was removed from ShellJS to reduce that module's dependencies and
2323
to shrink overall download size.
24+
25+
## Usage
26+
27+
You can install with `npm install shelljs-shjs`:
28+
29+
```shell
30+
$ npm install -g shelljs-shjs
31+
```
32+
33+
This script is a convenience wrapper for guessing the right interpreter to use
34+
for your script. It also brings your local shelljs install to the front of the
35+
`NODE_PATH` to ensure this is used.
36+
37+
```javascript
38+
#!/usr/bin/env shjs
39+
40+
// Save this demo as 'example_script.js'
41+
42+
var shell = require('shelljs');
43+
shell.echo('hello world');
44+
```
45+
46+
Then run the demo script with:
47+
48+
```shell
49+
$ shjs example_script.js
50+
hello world
51+
```

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
},
4242
"dependencies": {
4343
"interpret": "^1.2.0",
44-
"shelljs": "^0.9.2",
45-
"rechoir": "^0.7.0"
44+
"rechoir": "^0.7.0",
45+
"shelljs": "^0.9.2"
4646
},
4747
"devDependencies": {
4848
"ava": "^6.2.0",

0 commit comments

Comments
 (0)