Skip to content

Commit

Permalink
added bin and more readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dbouwman committed Feb 15, 2018
1 parent 72659ef commit 4b7e099
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion demos/node-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ This project uses the `commander` module, which streamlines the creation of node

Like all the other demo apps, run `npm run bootstrap` from the root.

### Running
If you use this demo as a starting point for your own command line package, you would publish it to npm, then on the target systems run `npm install <your-cli-package>`, and it would be available as a command.

But, this is demo code, and thus the package is not "installed" via `npm install ...`, before we can call it as `ago <command> <query>` we need to run `npm link` in the `/demos/node-cli` folder. After you do that, the command should work.

Here is a post with information on creating node command line tools: [A Guide to Creating a NodeJs Command](https://x-team.com/blog/a-guide-to-creating-a-nodejs-command/)

### Commands

| command | description | example |
Expand All @@ -19,4 +26,4 @@ Like all the other demo apps, run `npm run bootstrap` from the root.

## Building your own tooling

If you want to build out some commands of your own, you can also clone a stand-alone version of this repo from https://github.com/dbouwman/arcgis-rest-js-commands
If you want to build out some commands of your own, you can also clone a stand-alone version of this repo from https://github.com/dbouwman/arcgis-rest-js-commands
3 changes: 3 additions & 0 deletions demos/node-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"scripts": {
"start": "echo \"CLI - node index.js <search>\" && exit 1"
},
"bin": {
"ago":"./ago.js"
},
"private": true,
"keywords": [
"arcgis",
Expand Down

0 comments on commit 4b7e099

Please sign in to comment.