{"maintainers":[{"name":"anonymous","email":"daniel.mickael@gmail.com"}],"dist-tags":{"latest":"0.0.3"},"author":{"name":"mklabs"},"description":"nopt wrapper with commander-like API","readme":"### noptify\n\nnoptify is a little wrapper around `nopt` module adding a more expressive,\ncommander-like, API and few helpers.\n\nExamples\n\n     var program = noptify(process.argv, { program: 'name' })\n       .version('0.0.1')\n       .option('port', '-p', 'Port to listen on (default: 35729)', Number)\n       .option('pid', 'Path to the generated PID file', String)\n\n     var opts = program.parse();\n\nReturns an instance of `Noptify`\n\n### Noptify\n\nNoptify provides the API to parse out option, shorthands and generate the\nproper generic help output.\n\n- args     - The Array of arguments to parse (default: `process.argv`);\n- options  - An hash of options with the following properties\n  - program - The program name to use in usage output\n\nEvery noptify instance is created with two options, `-h, --help` and `-v,\n--version`.\n\n### Noptify#parse\n\nParse the provided options and shorthands, pass them through `nopt` and\nreturn the result.\n\nWhen `opts.help` is set, the help output is displayed and `help`\nevent is emitted. The process exists with `0` status, the help output is\nautomatically displayed and the `help` event is emitted.\n\nExamples\n\n    var program = noptify(['foo', '--help'])\n      .on('help', function() {\n        console.log('Examples');\n        console.log('');\n        console.log('  foo bar --baz > foo.txt');\n      });\n\n    var opts = program.parse();\n    // ... Help output ...\n    // ... Custom help output ...\n    // ... Exit ...\n\n\n\n### Noptify#version\n\nDefine the program version.\n\n### Noptify#option\n\nDefine `name` option with optional shorthands, optional description and optional type.\n\n### Noptify#help\n\nSimply output to stdout the Usage and Help output.\n\n","repository":{"type":"git","url":"git://github.com/mklabs/noptify.git"},"users":{"tunnckocore":true,"itonyyo":true},"versions":{"0.0.1":{"author":{"name":"mklabs"},"name":"noptify","description":"nopt wrapper with commander-like API","version":"0.0.1","repository":{"type":"git","url":"git://github.com/mklabs/noptify.git"},"dependencies":{"nopt":"~2.0.0"},"_npmUser":{"name":"anonymous","email":"daniel.mickael@gmail.com"},"_id":"noptify@0.0.1","devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"6fb12c7ee03b45d4bc2ce0eb14d55ee5d9df56e5","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/noptify/-/noptify-0.0.1.tgz","integrity":"sha512-x02cJfn+njrbm6dSo4C8KcTXqWEOi0Q+vBGgIv+9G3UT+LUpGp9HTHwcM6jcITXp2vkpfbttUThPCLfXjQeoBA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFjlAEXXLoUu8I/vbiDt0zDyMLjZ17VRVPEPFLjLRYC6AiBVGLFVLBplyoAnj1Qeij9nPwve5gJXIcaDLBk5b4SCAA=="}]},"maintainers":[{"name":"anonymous","email":"daniel.mickael@gmail.com"}]},"0.0.2":{"author":{"name":"mklabs"},"name":"noptify","description":"nopt wrapper with commander-like API","version":"0.0.2","repository":{"type":"git","url":"git://github.com/mklabs/noptify.git"},"dependencies":{"nopt":"~2.0.0"},"devDependencies":{"mocha":"~1.8.1"},"scripts":{"test":"mocha --reporter spec"},"_npmUser":{"name":"anonymous","email":"daniel.mickael@gmail.com"},"_id":"noptify@0.0.2","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"41a747eca667669db0a39204bf67431d6a1f98ca","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/noptify/-/noptify-0.0.2.tgz","integrity":"sha512-+/2hYu2LHQlLzsj7dJVB7UEY0BGBEETkZl8UlG9XwjYIYUOjH6j4XQ3M3eaHHHHulSUgxJHqJRTwdLbwnge9sQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAB3dJXvh6D/gcKtfYppARNhnHfby/b0Z9QFWzBPlwUgIhAL2ELIZDs8lkpNYc/l/XGJFsYYoWRSPMiGs/V84A0uG2"}]},"maintainers":[{"name":"anonymous","email":"daniel.mickael@gmail.com"}]},"0.0.3":{"author":{"name":"mklabs"},"name":"noptify","description":"nopt wrapper with commander-like API","version":"0.0.3","repository":{"type":"git","url":"git://github.com/mklabs/noptify.git"},"dependencies":{"nopt":"~2.0.0"},"devDependencies":{"mocha":"~1.8.1"},"scripts":{"test":"mocha --reporter spec"},"readme":"### noptify\n\nnoptify is a little wrapper around `nopt` module adding a more expressive,\ncommander-like, API and few helpers.\n\nExamples\n\n     var program = noptify(process.argv, { program: 'name' })\n       .version('0.0.1')\n       .option('port', '-p', 'Port to listen on (default: 35729)', Number)\n       .option('pid', 'Path to the generated PID file', String)\n\n     var opts = program.parse();\n\nReturns an instance of `Noptify`\n\n### Noptify\n\nNoptify provides the API to parse out option, shorthands and generate the\nproper generic help output.\n\n- args     - The Array of arguments to parse (default: `process.argv`);\n- options  - An hash of options with the following properties\n  - program - The program name to use in usage output\n\nEvery noptify instance is created with two options, `-h, --help` and `-v,\n--version`.\n\n### Noptify#parse\n\nParse the provided options and shorthands, pass them through `nopt` and\nreturn the result.\n\nWhen `opts.help` is set, the help output is displayed and `help`\nevent is emitted. The process exists with `0` status, the help output is\nautomatically displayed and the `help` event is emitted.\n\nExamples\n\n    var program = noptify(['foo', '--help'])\n      .on('help', function() {\n        console.log('Examples');\n        console.log('');\n        console.log('  foo bar --baz > foo.txt');\n      });\n\n    var opts = program.parse();\n    // ... Help output ...\n    // ... Custom help output ...\n    // ... Exit ...\n\n\n\n### Noptify#version\n\nDefine the program version.\n\n### Noptify#option\n\nDefine `name` option with optional shorthands, optional description and optional type.\n\n### Noptify#help\n\nSimply output to stdout the Usage and Help output.\n\n---\n\n*Mocha generated documentation*\n\n- [API](#api)\n- [Collectable](#collectable)\n- [Commandable](#commandable)\n  - [Parses remaining arguments and route to the appropriate command](#commandable-parses-remaining-arguments-and-route-to-the-appropriate-command)\n\n<a name=\"\"></a>\n\n<a name=\"api\"></a>\n## API\nreturns an instanceof Noptify.\n\n```js\nassert.ok(noptify() instanceof noptify.Noptify);\n```\n\nis typically used like so.\n\n```js\nvar program = noptify(['node', 'file.js', '-d', '--dirname', './', '-p', '3000', 'app.js', 'base.js'])\n  .option('debug', '-d', 'Enabled debug output', Boolean)\n  .option('dirname', 'The path to the output directory')\n  .option('port', '-p', 'The port you wish to listen on', Number)\n\n// opts => nopt result\nvar opts = program.parse();\n\nassert.deepEqual(opts, {\n  port: 3000,\n  debug: true,\n  dirname: './',\n  argv: {\n    remain: ['app.js', 'base.js'],\n    cooked: ['--debug', '--dirname', './', '--port', '3000', 'app.js', 'base.js'],\n    original: ['-d', '--dirname', './', '-p', '3000', 'app.js', 'base.js']\n  }\n});\n```\n\nallows definitiion of shorthands separately.\n\n```js\nvar opts = noptify(['node', 'file.js', '-lc'])\n  .option('line-comment', 'Ouputs with debugging information', Boolean)\n  .shorthand('lc', '--line-comment')\n  .parse();\n\nassert.equal(opts['line-comment'], true);\n```\n\n<a name=\"collectable\"></a>\n## Collectable\nprovides the helper method to read from stdin.\n\n```js\nvar program = noptify();\nassert.ok(typeof program.stdin === 'function', 'stdin defined');\n```\n\nis invoked only when .parse() is called.\n\n```js\nvar program = noptify(['', '']);\nvar str = 'testing out stdin helper';\nprogram.stdin(function(err, res) {\n  assert.equal(res, str);\n  done();\n});\n\nprogram.parse();\n\nprocess.nextTick(function() {\n  process.stdin.emit('data', str);\n  process.stdin.emit('end');\n});\n```\n\n<a name=\"commandable\"></a>\n## Commandable\nprovides the .command() utility.\n\n```js\nassert.ok(typeof noptify().command === 'function');\n```\n\n<a name=\"commandable-parses-remaining-arguments-and-route-to-the-appropriate-command\"></a>\n## Parses remaining arguments and route to the appropriate command\ncan be a simple function.\n\n```js\nvar program = noptify(['', '', 'init', '--debug', 'foo']).option('debug', 'an option');\n\nprogram.command('init', function(args, opts) {\n  // args ==> sliced args at command position\n  // opts ==> nopt parsed object\n  assert.deepEqual(args, ['--debug', 'foo']);\n  assert.equal(opts.debug, true);\n  assert.equal(opts.argv.remain[0], 'foo');\n  done();\n});\n\nprogram.parse();\n```\n\nor another program, an Noptify instance.\n\n```js\nvar args = ['', '', 'init', '--debug', 'myapp', 'foo'];\n\nvar init = noptify(args)\n  .option('debug', 'Debug output')\n  .command('myapp', done.bind(null, null));\n\nnoptify(args).command('init', init).parse();\n```\n\n","readmeFilename":"readme.md","_id":"noptify@0.0.3","dist":{"shasum":"58f654a73d9753df0c51d9686dc92104a67f4bbb","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/noptify/-/noptify-0.0.3.tgz","integrity":"sha512-EZT35r9AuK+hig+iYv4144kwfDEDhlj3zncVHw9b9d86TUYk/67BtBApkfPD1kslAT/8TTD262xdsVbV+iCSTw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMuMlzG0GVLjZ4Odjb1ZaGX0QvlcSb6aQBMGRPvpy59wIhALFRlPx2Xwri7Mcjb/uh96yjN3jwfiaSdSD9bi1mdrUQ"}]},"_npmVersion":"1.2.0","_npmUser":{"name":"anonymous","email":"daniel.mickael@gmail.com"},"maintainers":[{"name":"anonymous","email":"daniel.mickael@gmail.com"}]}},"name":"noptify","time":{"modified":"2022-06-22T05:10:41.856Z","created":"2013-01-05T19:21:49.552Z","0.0.1":"2013-01-05T19:21:52.245Z","0.0.2":"2013-01-09T21:06:24.099Z","0.0.3":"2013-01-13T23:22:15.295Z"}}