comment-tag-extractor

1.0.1 • Public • Published

comment-tag-extractor

Install

Install with npm:

$ npm install --save comment-tag-extractor

Install with yarn:

$ yarn add comment-tag-extractor

Usage

import {extract, parse} from 'comment-tag-extractor';
 
const code = `
  /**
    * @name Button
    * @description Button component.
    *
    * @class .btn
    * @class .btn--primary
    *
    * @example
    * <div class="{{modifier}}">Button</div>
    *
    * @section 1.3.2
    */
`;
 
const tags = parse(extract(code));
console.log(tags);
 
// Will output:
// {
//   name: [ 'Button' ],
//   description: [ 'Button component.' ],
//   class: [ '.btn', '.btn--primary' ],
//   example: [ '<div class="{{modifier}}">Button</div>' ],
//   section: [ '1.3.2' ]
// }

Mentions

Adapted from jest-codeblocks.

Package Sidebar

Install

npm i comment-tag-extractor

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • bajo