Package Exports
- extract-comments
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (extract-comments) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
extract-comments 
Extract code comments from string or from a glob of files.
Install
Install with npm:
npm i extract-comments --save-dev
Run tests
Run
npm test
API
extract
Extract code comments from the given string
.
string
{String}returns
{Object}: Object of code comments.
Example:
var extract = require('extract-comments');
extract('// this is a code comment');
.fromFiles
Extract code comments from a file or glob of files:
patterns
{String}: Glob patterns to used.options
{Object}: Options to pass to globby, or map-files.returns
{Object}: Object of code comments.
Example:
var extract = require('extract-comments');
extract.fromFiles(['lib/*.js']);
You may also pass a custom rename
function on the options to change the key of each object returned. See map-files for more details and available options.
Example results
{ 'fixtures/assemble.js':
// the line number
{ '1':
{ comment: '!\nassemble <https://github.com/assemble/assemble>\n\nCopyright (c) 2014 Jon Schlinkert, Brian Woodward, contributors.\nLicensed under the MIT license.\n',
begin: 1,
end: 6,
type: 'comment' }
Author
Jon Schlinkert
License
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license
This file was generated by verb-cli on September 24, 2014.