{"bugs":{"url":"https://github.com/airportyh/getargs/issues"},"dist":{"shasum":"2f3b14ece550e05e9b54a9d207e0221c597d6f9a","tarball":"https://registry.npmjs.org/getargs/-/getargs-0.0.5.tgz","integrity":"sha512-dqf8WRPRV4J24fhFXlhmbJeHpiRwel/+YK4ZPwrUZTMmJGWUeTpt1lAPnAuTnOeo/uWTjJ34W37uGFot++ajzQ==","signatures":[{"sig":"MEUCICYkGm1UPCJHEtZ8YbQWM0YK6Nx0AaZwULh108RMsDfgAiEA91nRkVH0hg8mYd27SBW0QhSLCPdZKbwHnFP9aC2n6Go=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","name":"getargs","_from":".","author":{"name":"Toby Ho"},"readme":"getargs\n=======\n\nSimple utility for parsing/processing variable length argument lists for Javascript functions; also verifies argument types and argument list length.\n\n## Install\n\nBower - `bower install getargs`; NPM - `npm install getargs`.\n\n## Usage\n\n    var getArgs = require('getargs')\n\n    function ajax(/* url:string, [options]:object, callback:function */){\n      var args = getArgs('url:string, [options]:object, callback:function', arguments)\n\n      console.log('url is', args.url)\n      console.log('options is optionally', args.options)\n      console.log('callback', args.callback)\n    }\n\n## Argument Spec Syntax\n\nThe argument spec is a comma delimited string of individual specs, which look like\n\n    argname:type\n\n* `argname` is the name of the argument, and can be called anything\n* `type` is a basic Javascript type. Currently these are supported\n  * `string`\n  * `boolean`\n  * `number`\n  * `object`\n  * `function`\n  * `array`\n\n### Optional Arguments\n\nTo denote optional arguments, you'd surround it with square brackets `[]`.\n\n### Spread Operator\n\nYou can mimick ES6's spread operator\n\n    var args = getArgs('first,...rest', [1,2,3,4])\n    console.log(args.first) // 1\n    console.log(args.rest)  // [2,3,4]\n\n### Set properties on an object\n\nIf you pass an object as its third argument, it will set the arguments as properties on that object.\n\n    getArgs('a,b,c', arguments, this)\n    // Now you can access the arguments by\n    // this.a, this.b, and this.c\n    ","license":"MIT","scripts":{"test":"mocha tests.js -u tdd"},"_npmUser":{"name":"airportyh","email":"airportyh@gmail.com"},"keywords":["arguments","utility"],"repository":{"url":"git@github.com:airportyh/getargs.git","type":"git"},"_npmVersion":"1.2.32","description":"Utility to handle optional arguments and argument type checking.","maintainers":[{"name":"airportyh","email":"airportyh@gmail.com"}],"dependencies":{},"readmeFilename":"README.md","devDependencies":{"chai":"~1.7.2"},"_id":"getargs@0.0.5","version":"0.0.5"}