comment-tag-extractor
v1.0.1
Published
Extract tags from docblock comments.
Downloads
10
Maintainers
Readme
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
.