JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 53820
  • Score
    100M100P100Q152969F

Extract code comments from string or from a glob of files.

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 NPM version

Extract code comments from string or from a glob of files.

Install

Install with npm:

npm i extract-comments --save-dev

Usage

var extract = require('extract-comments');

Pass file paths or glob patterns for the files with comments to be extracted:

var str = fs.readFileSync('index.js', 'utf8');
extract(str);

.parseFiles

Pass file paths or glob patterns for the files with comments to be extracted:

extract.parseFiles('lib/*.js');

Results in an object like this:

{
  "lib/somefile.js": [
    // array of code comments here
  ],
  "lib/another-file.js": [
    // array of code comments here
  ],
}

Tests

Run mocha

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license


This file was generated by verb-cli on August 25, 2014.