{"_id":"babel-extract-comments","_rev":"87483","name":"babel-extract-comments","description":"Uses babel (babylon) to extract JavaScript code comments from a JavaScript string or file.","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T10:28:26.000Z","created":"2015-12-30T19:03:44.368Z","1.0.0":"2018-02-12T08:00:58.257Z","0.1.0":"2015-12-30T19:03:44.368Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/babel-extract-comments.git"},"versions":{"1.0.0":{"name":"babel-extract-comments","description":"Uses babel (babylon) to extract JavaScript code comments from a JavaScript string or file.","version":"1.0.0","homepage":"https://github.com/jonschlinkert/babel-extract-comments","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/babel-extract-comments.git"},"bugs":{"url":"https://github.com/jonschlinkert/babel-extract-comments/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=4"},"scripts":{"test":"mocha"},"dependencies":{"babylon":"^6.18.0"},"devDependencies":{"gulp-format-md":"^1.0.0","mocha":"^3.5.3"},"keywords":["babel","block","code","comment","comments","context","extract","glob","javascript","parse"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["esprima-extract-comments","extract-comments","js-comments","parse-comments"]},"lint":{"reflinks":true}},"gitHead":"2f7a994397dcc108f52ecc6df85e82473c82f696","_id":"babel-extract-comments@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.1.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"shasum":"0a2aedf81417ed391b85e18b4614e693a0351a21","size":3285,"noattachment":false,"key":"/babel-extract-comments/-/babel-extract-comments-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-extract-comments/download/babel-extract-comments-1.0.0.tgz"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-extract-comments_1.0.0_1518422457561_0.3311836230494358"},"_hasShrinkwrap":false,"publish_time":1518422458257,"_cnpm_publish_time":1518422458257},"0.1.0":{"name":"babel-extract-comments","description":"Uses babel to extract JavaScript code comments from a string. Returns an array of comment objects, with line, column, index, comment type and comment string.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/babel-extract-comments","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/babel-extract-comments.git"},"bugs":{"url":"https://github.com/jonschlinkert/babel-extract-comments/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.8"},"scripts":{"test":"mocha"},"dependencies":{"babel-core":"^6.3.26"},"devDependencies":{"gulp-format-md":"^0.1.4"},"keywords":["block","code","comment","comments","context","babel","extract","glob","javascript","parse"],"verb":{"related":{"list":["esprima-extract-comments","extract-comments","js-comments","parse-comments"]},"plugins":["gulp-format-md"],"layout":"default"},"gitHead":"d3e3c0fedb17806de34fb23ff26796e3f5b8c46c","_id":"babel-extract-comments@0.1.0","_shasum":"ec5944ba91fe2797876616d2ec9a43efb98691cd","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"ec5944ba91fe2797876616d2ec9a43efb98691cd","size":2778,"noattachment":false,"key":"/babel-extract-comments/-/babel-extract-comments-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-extract-comments/download/babel-extract-comments-0.1.0.tgz"},"directories":{},"publish_time":1451502224368,"_cnpm_publish_time":1451502224368,"_hasShrinkwrap":false}},"readme":"# babel-extract-comments [![NPM version](https://img.shields.io/npm/v/babel-extract-comments.svg?style=flat)](https://www.npmjs.com/package/babel-extract-comments) [![NPM monthly downloads](https://img.shields.io/npm/dm/babel-extract-comments.svg?style=flat)](https://npmjs.org/package/babel-extract-comments) [![NPM total downloads](https://img.shields.io/npm/dt/babel-extract-comments.svg?style=flat)](https://npmjs.org/package/babel-extract-comments) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/babel-extract-comments.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/babel-extract-comments)\n\n> Uses babel (babylon) to extract JavaScript code comments from a JavaScript string or file.\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 babel-extract-comments\n```\n\n## Usage\n\nAdd to your Node.js/JavaScript project with the following line of code:\n\n```js\nconst extract = require('babel-extract-comments');\n```\n\n## API\n\n### [extract](index.js#L32)\n\nExtract code comments from the given `string`.\n\n**Params**\n\n* `string` **{String}**: String of javascript\n* `returns` **{Array}**: Array of code comment objects.\n\n**Example**\n\n```js\nvar extract = require('babel-extract-comments');\nconsole.log(extract('// this is a code comment'));\n// [{ type: 'CommentBlock',\n//  value: '!\\n * babel-extract-comments <https://github.com/jonschlinkert/babel-extract-comments>\\n *\\n *\n// Copyright (c) 2014-2018, Jon Schlinkert.\\n * Released under the MIT License.\\n ',\n//   start: 0,\n//   end: 173,\n//   loc: SourceLocation { start: [Position], end: [Position] } }]\n```\n\n### [.file](index.js#L53)\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* [esprima-extract-comments](https://www.npmjs.com/package/esprima-extract-comments): Extract code comments from string or from a glob of files using esprima. | [homepage](https://github.com/jonschlinkert/esprima-extract-comments \"Extract code comments from string or from a glob of files using esprima.\")\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### Contributors\n\n| **Commits** | **Contributor** | \n| --- | --- |\n| 4 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 1 | [eventualbuddha](https://github.com/eventualbuddha) |\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._","_attachments":{},"homepage":"https://github.com/jonschlinkert/babel-extract-comments","bugs":{"url":"https://github.com/jonschlinkert/babel-extract-comments/issues"},"license":"MIT"}