File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ # Plugin support
2+
3+ Did you know that ` shx ` can also take advantage of all the great
4+ [ ShellJS plugins] ( https://www.npmjs.com/search?q=keyword%3Ashelljs%2Cplugin ) ?
5+ Here's how to get started using plugins with your project:
6+
7+ ## Using plugins from inside package.json scripts
8+
9+ ``` shell
10+ $ npm install --save-dev shx
11+ $ npm install --save-dev shelljs-plugin-sleep
12+ ```
13+
14+ Define a file named ` .shxrc.json ` to tell ` shx ` which plugins to load:
15+
16+ ``` json
17+ {
18+ "plugins" : [
19+ " shelljs-plugin-sleep"
20+ ]
21+ }
22+ ```
23+
24+ Define a script in package.json which invokes the desired ` shx ` plugin as a
25+ command:
26+
27+ ``` json
28+ {
29+ "scripts" : {
30+ "my-cool-script" : " echo 'sleep for 3 seconds' && shx sleep 3"
31+ }
32+ }
33+ ```
34+
35+ And now you can run your package.json script:
36+
37+ ``` shell
38+ $ npm run my-cool-script
39+ ```
40+
41+ ** Note:** ` shx ` will only load plugins if a ` .shxrc.json ` file is present in the
42+ working directly, so it's recommended to add this file to the top level of each
43+ project which needs to use the plugin.
Original file line number Diff line number Diff line change @@ -153,6 +153,12 @@ supported options:
153153| N/A | N/A | ` shx --help ` | Show help text. |
154154| N/A | N/A | ` shx --version ` | Print the shx version. |
155155
156+ ### Plugin support
157+
158+ Did you know that ` shx ` can also take advantage of all the great
159+ [ ShellJS plugins] ( https://www.npmjs.com/search?q=keyword%3Ashelljs%2Cplugin ) ?
160+ See [ PLUGINS.md] ( ./PLUGINS.md ) for instructions.
161+
156162## Team
157163
158164| [ ![ Nate Fischer] ( https://avatars.githubusercontent.com/u/5801521?s=130 )] ( https://github.com/nfischer ) | [ ![ Ari Porad] ( https://avatars1.githubusercontent.com/u/1817508?v=3&s=130 )] ( http://github.com/ariporad ) | [ ![ Levi Thomason] ( https://avatars1.githubusercontent.com/u/5067638?v=3&s=130 )] ( https://github.com/levithomason ) |
You can’t perform that action at this time.
0 commit comments