{
  "_args": [
    [
      "comment-parser@https://registry.npmjs.org/comment-parser/-/comment-parser-0.3.1.tgz",
      "/Users/gajus/Documents/dev/canonical-code-style/canonical"
    ]
  ],
  "_from": "comment-parser@>=0.3.1 <0.4.0",
  "_id": "comment-parser@0.3.1",
  "_inCache": true,
  "_location": "/comment-parser",
  "_phantomChildren": {},
  "_requested": {
    "name": "comment-parser",
    "raw": "comment-parser@https://registry.npmjs.org/comment-parser/-/comment-parser-0.3.1.tgz",
    "rawSpec": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.3.1.tgz",
    "scope": null,
    "spec": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.3.1.tgz",
    "type": "remote"
  },
  "_requiredBy": [
    "/eslint-plugin-jsdoc"
  ],
  "_resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.3.1.tgz",
  "_shasum": "fd657aac8c1492d308c9a6100fc9b49d2435aba1",
  "_shrinkwrap": null,
  "_spec": "comment-parser@https://registry.npmjs.org/comment-parser/-/comment-parser-0.3.1.tgz",
  "_where": "/Users/gajus/Documents/dev/canonical-code-style/canonical",
  "author": {
    "email": "yavorskiy.s@gmail.com",
    "name": "Sergii Iavorskyi",
    "url": "https://github.com/yavorskiy"
  },
  "bugs": {
    "url": "https://github.com/yavorskiy/comment-parser/issues"
  },
  "dependencies": {
    "readable-stream": "^2.0.4"
  },
  "description": "Generic JSDoc-like comment parser. ",
  "devDependencies": {
    "chai": "~1.9.0",
    "jshint": "^2.5.10",
    "jshint-stylish": "^1.0.0",
    "mocha": "~1.17.1",
    "nodemon": "^1.2.1"
  },
  "directories": {
    "test": "tests"
  },
  "homepage": "https://github.com/yavorskiy/comment-parser",
  "keywords": [
    "comments",
    "jsdoc",
    "parser"
  ],
  "license": "MIT",
  "main": "index.js",
  "name": "comment-parser",
  "optionalDependencies": {},
  "readme": "# comment-parser\n\n\nGeneric JSDoc-like comment parser. This library is not intended to be documentation generator, but rather composite unit for it.\n\n`npm install comment-parser`\n\nModule provides `parse(s:String[, opts:Object]):Object` function which takes `/** ... */` comment string and returns array  of objects with parsed data.\n\nIt is not trying to detect relations between tags or somehow recognize their meaning. Any tag can be used, as long as it satisfies the format.\n\n```\n/**\n * Singleline or multiline description text. Line breaks are preserved.\n *\n * @some-tag {Type} name Singleline or multiline description text\n * @some-tag {Type} name.subname Singleline or multiline description text\n * @some-tag {Type} name.subname.subsubname Singleline or\n * multiline description text\n * @another-tag\n */\n```\n\nthis would be parsed into following\n\n```javascript\n[{\n  \"tags\": [{\n    \"tag\": \"some-tag\",\n    \"type\": \"Type\",\n    \"name\": \"name\",\n    \"optional\": false,\n    \"description\": \"Singleline or multiline description text\",\n    \"line\": 3,\n    \"source\": \"@some-tag {Type} name Singleline or multiline description text\"\n  }, {\n    \"tag\": \"some-tag\",\n    \"type\": \"Type\",\n    \"name\": \"name.subname\",\n    \"optional\": false,\n    \"description\": \"Singleline or multiline description text\",\n    \"line\": 4,\n    \"source\": \"@some-tag {Type} name.subname Singleline or multiline description text\"\n  }, {\n    \"tag\": \"some-tag\",\n    \"type\": \"Type\",\n    \"name\": \"name.subname.subsubname\",\n    \"optional\": false,\n    \"description\": \"Singleline or\\nmultiline description text\",\n    \"line\": 5,\n    \"source\": \"@some-tag {Type} name.subname.subsubname Singleline or\\nmultiline description text\"\n  }, {\n    \"tag\": \"another-tag\",\n    \"name\": \"\",\n    \"optional\": false,\n    \"type\": \"\",\n    \"description\": \"\",\n    \"line\": 7,\n    \"source\": \"@another-tag\"\n  }],\n  \"line\": 0,\n  \"description\": \"Singleline or multiline description text. Line breaks are preserved.\",\n  \"source\": \"Singleline or multiline description text. Line breaks are preserved.\\n\\n@some-tag {Type} name Singleline or multiline description text\\n@some-tag {Type} name.subname Singleline or multiline description text\\n@some-tag {Type} name.subname.subsubname Singleline or\\nmultiline description text\\n@another-tag\"\n}]\n```\n\nBy default dotted names like `name.subname.subsubname` will be expanded into nested sections, this can be prevented by passing `opts.dotted_names = false`.\n\nInvalid comment blocks are skipped. Comments starting with `/*` and `/***` are considered not valid.\n\nAlso you can parse entire file with `parse.file('path/to/file', callback)` or acquire an instance of [Transform](http://nodejs.org/api/stream.html#stream_class_stream_transform) stream with `parse.stream()`.\n\n## Custom parsers\n\n\nIn case you need to parse tags in different way you can pass `opts.parsers = [parser1, ..., parserN]`, where each parser is `function name(str:String, data:Object):{source:String, data:Object}`.\n\t\nEach parser function takes string left after previous parsers applied and data produced by them. And returns `null` or `{source: '', data:{}}` where `source` is consumed substring and `data` is a payload with tag node fields.\n\nTag node data is build by merging result bits from all parsers. Here is some example that is not doing actual parsing but is demonstrating the flow:\n\n```\n/**\n * Source to be parsed below\n * @tag {type} name Description\n */\nparse(source, {parsers: [\n\t// takes entire string\n\tfunction parse_tag(str, data) { \n\t\treturn {source: ' @tag', data: {tag: 'tag'}}; \n\t}, \n\t// parser throwing exception\n\tfunction check_tag(str, data) {\n\t\tif (allowed_tags.indexOf(data.tag) === -1) { \n\t\t\tthrow new Error('Unrecognized tag \"' + data.tag + '\"');\n\t\t}\t\t\t\n\t},\n\t// takes the rest of the string after ' @tag''\n\tfunction parse_name1(str, data) { \n\t\treturn {source: ' name', data: {name: 'name1'}}; \n\t},\n\t// alternative name parser\n\tfunction parse_name2(str, data) { \n\t\treturn {source: ' name', data: {name: 'name2'}}; \n\t}\t\n]});\n```\n\nThis would produce following:\n\n```\n[{\n  \"tags\": [{\n    \"tag\": \"tag\",\n    \"errors\": [\n      \"check_tag: Unrecognized tag \\\\\"tag\\\\\"\"\n    ],\n    \"name\": \"name2\",\n    \"optional\": false,\n    \"type\": \"\",\n    \"description\": \"\",\n    \"line\": 2,\n    \"source\": \"@tag {type} name Description\"\n  }],\n  \"line\": 0,\n  \"description\": \"Source to be parsed below\",\n  \"source\": \"Source to be parsed below\\n@tag {type} name Description\"\n}]\n```\n\n## Packaging\n\n`comment-parser` is CommonJS module and was primarely designed to be used with Node. Module `index.js` includes stream and file functionality. Use prser-only module in browser `comment-parser/parse.js`\n\n## Contributors\n\n\n- [Sergii Iavorskyi](https://github.com/yavorskiy)\n- [Alexej Yaroshevich](https://github.com/zxqfox)\n- [Jordan Harband](https://github.com/ljharb)\n\n\nHappy coding :)\n",
  "readmeFilename": "README.md",
  "repository": {
    "type": "git",
    "url": "git+ssh://git@github.com/yavorskiy/comment-parser.git"
  },
  "scripts": {
    "test": "jshint --reporter node_modules/jshint-stylish/stylish.js index.js && mocha tests/*",
    "watch": "nodemon -q -w index.js -w tests/ -x npm test"
  },
  "version": "0.3.1"
}
