Skip to content

jweinst1/commentfarmer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CommentFarmer

Intro

CommentFarmer is a node package that can parse out single or multi line comments from javascript or other languages which use the // or /* */ system for denoting comments. Is it available on NPM for installation.

Installation

To install type in your shell

$ npm install commentfarmer

Usage

To initalize on instance of the parser,

var ps = require('commentfarmer');
var parser = new ps.JSCommentParser();

to parse a string,

parser.parse("var g = 7; //this line assigns a variable\n var h = 7 //so does this one\n");

to get the comments or clear them,

console.log(parser.getComments()); // 'this line assigns a variable, so does this one'
parser.clearComments();

License

This code is MIT licensed

Contribution

Feel free to suggest changes or contribute

About

A Javascript Parser for Javascript style comments

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published