{"name":"esprima-extract-comments","description":"Extract code comments from string or from a glob of files using esprima.","version":"0.2.0","homepage":"https://github.com/jonschlinkert/esprima-extract-comments","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/esprima-extract-comments.git"},"bugs":{"url":"https://github.com/jonschlinkert/esprima-extract-comments/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.8"},"scripts":{"test":"mocha"},"dependencies":{"esprima":"^2.7.0","extend-shallow":"^2.0.1"},"keywords":["block","code","comment","comments","context","esprima","extract","glob","javascript","parse"],"verb":{"related":{"list":["extract-comments","parse-comments","js-comments"]}},"gitHead":"774db35b9a0c656e1297289cf673fb604952d13e","_id":"esprima-extract-comments@0.2.0","_shasum":"e06dc54f368dc31f13d19e042bcf0b2ae02432fb","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"},{"name":"doowb","email":"brian.woodward@gmail.com"}],"dist":{"shasum":"e06dc54f368dc31f13d19e042bcf0b2ae02432fb","tarball":"http://registry-npm.ywwl.com/esprima-extract-comments/download/esprima-extract-comments-0.2.0.tgz","integrity":"sha512-5MKRODJG0FVhIdasd49wepfphIGdFDngiopT4iCj/5IyVcGFYiftoAGZITqU4wBzjKImpQUMZVhCMTwBadfJOQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTj0Mi/7yKzr6BTbSHom5m0CEyab5jK0DShP7oHdugDQIgdze4M978vAbzvcwLKRqNIj5oHzckMwbm28CqoAi8rgM="}],"size":2344,"noattachment":false,"key":"/esprima-extract-comments/-/esprima-extract-comments-0.2.0.tgz"},"directories":{},"readme":"# esprima-extract-comments [![NPM version](https://img.shields.io/npm/v/esprima-extract-comments.svg?style=flat)](https://www.npmjs.com/package/esprima-extract-comments) [![NPM monthly downloads](https://img.shields.io/npm/dm/esprima-extract-comments.svg?style=flat)](https://npmjs.org/package/esprima-extract-comments) [![NPM total downloads](https://img.shields.io/npm/dt/esprima-extract-comments.svg?style=flat)](https://npmjs.org/package/esprima-extract-comments) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/esprima-extract-comments.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/esprima-extract-comments)\n\n> Extract code comments from string or from a glob of files using esprima.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save esprima-extract-comments\n```\n\n## Breaking changes in v1.0.0!\n\n* line `comment.type` was changed from `line` to `LineComment`\n* block `comment.type` was changed from `block` to `BlockComment`\n\n## Usage\n\nAdd to your Node.js/JavaScript project with the following line of code:\n\n```js\nconst extract = require('esprima-extract-comments');\n```\n\n## API\n\n### [extract](index.js#L30)\n\nExtract line and block comments from a string of JavaScript.\n\n**Params**\n\n* `string` **{String}**\n* `options` **{Object}**: Options to pass to [esprima](http://esprima.org).\n* `returns` **{Array}**: Array of code comment objects.\n\n**Example**\n\n```js\nconsole.log(extract('// this is a line comment'));\n// [ { type: 'Line',\n//     value: ' this is a line comment',\n//     range: [ 0, 25 ],\n//     loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 25 } } } ]\n```\n\n### [.file](index.js#L52)\n\nExtract code comments from a JavaScript file.\n\n**Params**\n\n* `file` **{String}**: Filepath to the file to parse.\n* `options` **{Object}**: Options to pass to [esprima](http://esprima.org).\n* `returns` **{Array}**: Array of code comment objects.\n\n**Example**\n\n```js\nconsole.log(extract.file('some-file.js'), { cwd: 'some/path' });\n// [ { type: 'Line',\n//     value: ' this is a line comment',\n//     range: [ 0, 25 ],\n//     loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 25 } } } ]\n```\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n</details>\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [extract-comments](https://www.npmjs.com/package/extract-comments): Uses esprima to extract line and block comments from a string of JavaScript. Also optionally… [more](https://github.com/jonschlinkert/extract-comments) | [homepage](https://github.com/jonschlinkert/extract-comments \"Uses esprima to extract line and block comments from a string of JavaScript. Also optionally parses code context (the next line of code after a comment).\")\n* [js-comments](https://www.npmjs.com/package/js-comments): Parse JavaScript code comments and generate API documentation. | [homepage](https://github.com/jonschlinkert/js-comments \"Parse JavaScript code comments and generate API documentation.\")\n* [parse-comments](https://www.npmjs.com/package/parse-comments): Parse code comments from JavaScript or any language that uses the same format. | [homepage](https://github.com/jonschlinkert/parse-comments \"Parse code comments from JavaScript or any language that uses the same format.\")\n\n### Author\n\n**Jon Schlinkert**\n\n* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert)\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on February 12, 2018._","publish_time":1447161526333,"_cnpm_publish_time":1447161526333,"dist-tags":{"latest":"1.1.0"}}