From ac1d726c081d08c8dfaf6e14883be39f40068e22 Mon Sep 17 00:00:00 2001 From: Pavan Kumar Sunkara Date: Thu, 29 Mar 2012 00:37:56 +0530 Subject: [PATCH] Initial commit --- LICENSE | 19 +++++++++++++++ README.md | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++ index.js | 21 ++++++++++++++++ package.json | 39 ++++++++++++++++++++++++++++++ 4 files changed, 146 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 index.js create mode 100644 package.json diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..276ec65 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011 Nodejitsu Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..9f84938 --- /dev/null +++ b/README.md @@ -0,0 +1,67 @@ +# flatiron-cli-ok +Encapsulated logic for showing ok in flatiron CLI apps + +## Installation +``` +npm install flatiron-cli-ok +``` + +## Usage +At its core `flatiron-cli-ok` is a broadway-compatible plugin which can be used by any [flatiron](https://flatironjs.org) application + +```js +var flatiron = require('flatiron') + , app = flatiron.app; + +// +// Configure the Application to be a CLI app with +// a JSON configuration file `test-config.json` +// +app.name = 'app.js'; + +app.use(flatiron.plugins.cli, { + usage: 'A simple CLI app using flatiron-cli-ok' +}); + +app.use(require('flatiron-cli-ok')); + +if (!module.parent) { + app.start(); +} +``` + +If you run the above script + +```bash +$ node app.js +``` + +The output will be + +```bash +``` + +If you like this project, please watch this and [follow](http://github.com/users/follow?target=pksunkara) me. + +## Testing +``` +npm test +``` + +## Contributors +Here is a list of [Contributors](http://github.com/pksunkara/flatiron-cli-ok/contributors) + +### TODO + +__I accept pull requests and guarantee a reply back within a day__ + +## License +MIT/X11 + +## Bug Reports +Report [here](http://github.com/pksunkara/flatiron-cli-ok/issues). __Guaranteed reply within a day__. + +## Contact +Pavan Kumar Sunkara (pavan.sss1991@gmail.com) + +Follow me on [github](http://github.com/pksunkara), [twitter](http://twitter.com/pksunkara) diff --git a/index.js b/index.js new file mode 100644 index 0000000..4017bdb --- /dev/null +++ b/index.js @@ -0,0 +1,21 @@ +/* + * index.js: Top-level include for flatiron-cli-ok + * + * (C) 2012, Pavan Kumar Sunkara + * + */ + +var path = require('path'); + +var cliOk = exports = module.exports; + +cliOk.name = 'cli-ok'; + +cliOk.attach = function (options) { + var app = this; + options = options || {}; + + if (!app.plugins.cli) { + throw new Error('`cli` plugin is required to use `flatiron-cli-ok`'); + } +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..74d71da --- /dev/null +++ b/package.json @@ -0,0 +1,39 @@ +{ + "name": "flatiron-cli-ok", + "version": "0.1.0", + "author": "Pavan Kumar Sunkara (pksunkara.github.com)", + "description": "Encapsulated logic for showing ok in flatiron CLI apps", + "main": "./index", + "repository": { + "type": "git", + "url": "git://github.com/pksunkara/flatiron-cli-ok.git" + }, + "keywords": [ + "flatiron", + "cli", + "ok", + "plugin" + ], + "homepage": "http://pksunkara.github.com/flatiron-cli-ok", + "scripts": {}, + "contributors": [ + { + "name": "Pavan Kumar Sunkara", + "email": "pavan.sss1991@gmail.com" + } + ], + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.6" + }, + "bugs": { + "url": "https://github.com/pksunkara/flatiron-cli-ok/issues" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/pksunkara/flatiron-cli-ok/raw/master/LICENSE" + } + ] +}