line-comment-parser

0.0.4 • Public • Published

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"

Readme

Keywords

none

Package Sidebar

Install

npm i line-comment-parser

Weekly Downloads

2

Version

0.0.4

License

ISC

Last publish

Collaborators

  • hugodf