{"_id":"parms","_rev":"29-2245ee8c5860e6ea484aae5e898ba1bf","time":{"modified":"2022-05-12T14:26:07.003Z","created":"2022-03-17T06:57:09.646Z","0.0.1":"2014-07-28T03:48:21.103Z","0.0.2":"2014-07-28T21:38:43.147Z","0.0.3":"2014-07-28T21:53:41.363Z","0.0.4":"2014-07-28T21:56:09.705Z","0.0.5":"2014-07-29T02:07:16.154Z","0.0.7":"2014-07-29T02:20:52.501Z","0.0.8":"2014-07-29T15:01:02.048Z","0.0.9":"2014-07-29T18:22:50.244Z","0.0.11":"2014-07-29T20:36:40.878Z","0.1.0":"2014-07-29T21:26:53.047Z","0.1.1":"2014-07-29T22:09:53.205Z","0.1.2":"2014-11-20T00:55:35.492Z","0.1.3":"2022-03-17T06:57:09.812Z"},"name":"parms","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.3":{"name":"parms","version":"0.1.3","description":"Decode a function's parameters and parameter comments.","main":"src/parms.js","scripts":{"test":"mocha","prepublish":"grunt default"},"repository":{"type":"git","url":"git://github.com/ChrisAckerman/parms.git"},"keywords":["function","specification","param","parameter","prototype","reflection","method","annotate","annotation","comment","type"],"author":{"name":"Chris Ackerman","email":"bluejeansandrain@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/ChrisAckerman/parms/issues"},"homepage":"https://github.com/ChrisAckerman/parms","devDependencies":{"grunt":"^0.4.5","grunt-browserify":"^2.1.4","grunt-cli":"^0.1.13","grunt-contrib-jshint":"^0.10.0","grunt-contrib-uglify":"^0.5.1","grunt-contrib-yuidoc":"^0.5.2","grunt-mocha-test":"^0.11.0","mocha":"^1.21.3","should":"^4.0.4"},"gitHead":"6cd7a41a69be780aa3f6a001e95898cb61a20ea0","_id":"parms@0.1.3","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-9FfYCFlH0ai85b7HBdEeysEGQvotCMT8fybU62XaNKOdOwBnU3qyL9LighUHyfzRrtNejJlV/baNkjGv3eY4+w==","shasum":"17e2ef03ba11298a8d27bbf27f15cc35fe7cb424","tarball":"https://registry.npmjs.org/parms/-/parms-0.1.3.tgz","fileCount":13,"unpackedSize":17877,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMtvFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqPGQ//cxJZXnkCCK5fJl3miIBVIc/pR4/TvB+MT4PerImgtctgHqJm\r\nJQOhD6ZWjJASYe8NyFf7c92za+gKYBnJidHFXNRLuPt4bwgJCU+MGot7Cvul\r\nuUTAs6hay4eY4TUu9kCpf+YWMW7v97ayCxPaBZrLUnqOcB5Gc6JnB5EUwRyI\r\nFIVUeA5BYQH+LvUV3iuLvzPHBu1VHz1UcTtH0uFWVTPDR4GemcLWCThLEaXK\r\nUeed6zr66G2u0QQvhitNX28E6xWnI5pzk46e33ewJde+JslcloyJZWspjvW5\r\n/zcAxOP9pwt8hy/E/Loowm3Cffwq5u06JP4pjJmRrmknKWv3ENl3VueM9Gg5\r\ned4kGMbYYVbrbxVgL7smfxXMkFwT8tvLZBhVwGZu1JozR3d4qEKm4Eu4z+2X\r\nZqZmnN8RGCJBypyMGvwuFaNbXmDlqiEvKhbk+gNnND03/akcxmOaukbKm0+j\r\nIv8NOsmt7wJli/QTrhWdSVHa0wQk0iaYmX+lDDV0kWofyE+HLzGlGWBKZvc9\r\nmEAmivefJqOOLbA5dOKQBfAelW14uPfko9vtGIy8wYO4pk98gbpU51wMWd2i\r\nJ+FA7PJ/szBafFMEXRifDrdZUEkVsCr03TRBJkFvcsMb7SlMspAA0u+WvUwz\r\nrBAje5DYqDCtlnBypoeTXLtmU+SU9Z++OPA=\r\n=xMER\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7lYGs2iN/aY8Z8qnZ0nk7wWIguL7Q4bW9K48IWuydZwIgYVUTGaGS3UA3ej9vkst1vPnnfxR4SB0WIGuTNrhKk2A="}]},"_npmUser":{"name":"daycool","email":"qmw920@163.com"},"directories":{},"maintainers":[{"name":"daycool","email":"qmw920@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parms_0.1.3_1647500229646_0.6846621364523413"},"_hasShrinkwrap":false}},"maintainers":[{"name":"daycool","email":"qmw920@163.com"}],"description":"Decode a function's parameters and parameter comments.","homepage":"https://github.com/ChrisAckerman/parms","keywords":["function","specification","param","parameter","prototype","reflection","method","annotate","annotation","comment","type"],"repository":{"type":"git","url":"git://github.com/ChrisAckerman/parms.git"},"author":{"name":"Chris Ackerman","email":"bluejeansandrain@gmail.com"},"bugs":{"url":"https://github.com/ChrisAckerman/parms/issues"},"license":"MIT","readme":"#parms [![Build Status](https://travis-ci.org/ChrisAckerman/parms.svg?branch=master)](https://travis-ci.org/ChrisAckerman/parms)\n\nDecode a Javascript function's parameters and parameter comments.\n\nThis utility was written for use in the [radish](https://www.npmjs.org/package/radish) dependency injection container.\n\nAll engines in which Function.prototype.toString returns the function source (IE8+, Node.js, etc.) should be supported.\n\n##Installation\n\nUse NPM to install it (recommended).\n```\n> npm install parms\n```\n\nClone it from GitHub.\n```\n> git clone git@github.com:ChrisAckerman/parms.git\n> cd parms\n> npm install\n```\n\nRequire it in Node.js\n```javascript\nvar parms = require('parms');\n```\n\nInclude it in the browser. The utility will be available at `window.parms`\n```html\n<script src=\"path/to/parms/dist/parms.min.js\"></script>\n```\n\n## Usage\n\n```javascript\nfunction myFunc(/* Foo.matic */ foo, /* Bar.none */ bar /* Or trailing comments if you like */,\n\t// Supports line-breaks and single-line comments too.\n\tbaz\n) {\n\t...\n}\n\nvar parameters = parms(myFunc);\n```\n\nThe `parameters` variable will contain something like the following:\n\n```json\n[\n\t{\n\t\t\"start\": 0,\n\t\t\"end\": 19,\n\t\t\"text\": \"/* Foo.matic */ foo\",\n\t\t\"name\": {\n\t\t\t\"text\": \"foo\",\n\t\t\t\"start\": 16,\n\t\t\t\"end\": 19\n\t\t},\n\t\t\"comments\": [\n\t\t\t{\n\t\t\t\t\"text\": \" Foo.matic \",\n\t\t\t\t\"start\": 2,\n\t\t\t\t\"end\": 13,\n\t\t\t\t\"style\": \"block\",\n\t\t\t\t\"placement\": \"before\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"start\": 20,\n\t\t\"end\": 78,\n\t\t\"text\": \" /* Bar.none */ bar /* Or trailing comments if you like */\",\n\t\t\"name\": {\n\t\t\t\"text\": \"bar\",\n\t\t\t\"start\": 36,\n\t\t\t\"end\": 39\n\t\t},\n\t\t\"comments\": [\n\t\t\t{\n\t\t\t\t\"text\": \" Bar.none \",\n\t\t\t\t\"start\": 23,\n\t\t\t\t\"end\": 33,\n\t\t\t\t\"style\": \"block\",\n\t\t\t\t\"placement\": \"before\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"text\": \" Or trailing comments if you like \",\n\t\t\t\t\"start\": 42,\n\t\t\t\t\"end\": 76,\n\t\t\t\t\"style\": \"block\",\n\t\t\t\t\"placement\": \"after\"\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"start\": 79,\n\t\t\"end\": 124,\n\t\t\"text\": \"\\n\\t// Supports line-breaks and single-line comments too.\\n\\tbaz\\n\",\n\t\t\"name\": {\n\t\t\t\"text\": \"baz\",\n\t\t\t\"start\": 120,\n\t\t\t\"end\": 123\n\t\t},\n\t\t\"comments\": [\n\t\t\t{\n\t\t\t\t\"text\": \" Supports line-breaks and single-line comments too.\",\n\t\t\t\t\"start\": 83,\n\t\t\t\t\"end\": 118,\n\t\t\t\t\"style\": \"line\",\n\t\t\t\t\"placement\": \"before\"\n\t\t\t}\n\t\t]\n\t}\n]\n```\n\n* Text values are not trimmed.\n* Start and end indexes are from the opening parenthesis `(` of the argument list.\n* Comment style may be \"block\" or \"line\".\n* Comment placement may be \"before\" or \"after\" indicating that the comment came before or after the parameter name.\n\nThe following would give you a simple array of parameter names.\n\n```javascript\nfor (var i = 0, max = parameters.length; i < max; ++i) {\n\tparameters[i] = parameters[i].name.text;\n}\n```\n\nThe `parameters` variable now contains:\n\n```json\n[\n\t\"foo\",\n\t\"bar\",\n\t\"baz\"\n]\n```\n\n### Source String\n\nA source string can also be used instead of a source function. Passing the source text of a function should produce\nexactly the same result as passing the function itself, though technically only the `function(...)` part is necessary\nbecause the body of the function is not used.\n\nAccepting a string source allows for preprocessing of the function source.\n\n```javascript\nvar parameters = parms(myFunc.toString());\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2014 Chris Ackerman\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","readmeFilename":"README.md"}