0.0.4 • Published 9 years ago
line-comment-parser v0.0.4
Line Comment Parser
Simple and partially wrong parser using // as the start delimiter and \n as the end delimiter of comments
Module
The module has 4 properties:
- comment(arg) which returns the start delimiter if arg is 'start' and end if arg is 'end'
- regex() which returns the regex used to find the comments
- hasComments(str) which returns true if the str passed contains comments and false otherwise (this is an alias for RegExp.test(str) that uses the regex defined in the module)
- getComments(str) returns the array of comments stripped of "//" and "\n"