0.5.5 • Published 7 years ago

parse-comment-es6 v0.5.5

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

parse-comment-es6

NPM version Build Status

A new comment parse for es6

Install

npm install parse-comment-es6 --save
yarn add parse-comment-es6

Usage

import strip from 'parse-comment-es6';
const p = '`aaa`\n//abc\n';
console.log(strip(p, { comment: true, range: true, loc: true, raw: true }));
// =>
//    text: '`aaa`\n\n',
//    comments: [
//        {
//             type: 'LineComment',
//             raw: '//abc'
//             loc: {
//                 start: {
//                     line: 1,
//                     column: 0,
//                 },
//                 end: {
//                     line: 1,
//                     column: 5,
//                 },
//             },
//             range: {
//                 start: 6,
//                 end: 11,
//             },
//       }
//   ]
// };

Option

PropertyDescriptionTypeDefault
commentneed to return comment listbooleanfalse
rawneed to return comment raw, comment option should be truebooleanfalse
locneed to return comment loc, comment option should be truebooleanfalse
rangeneed to return comment range, comment option should be truebooleanfalse

Test

test past using jquery, react, react-dom

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

0.5.5

7 years ago

0.5.4

7 years ago

0.5.3

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago