npm install cimentciment
========
ciment is a library for generating comment-String rapidly. Include javascript, CSS and HTML commnets manipulation.
``javascript
`
var comment = require('ciment');
// Comment module methods
comment.single('hello world'); // result: "// hello world"
comment.block('hello world'); // result: "/ hello world /"
// Prototype module methods
'hello world'.single(); // result: "// hello world"
'hello world'.block(); // result: "/ hello world /"
'hello world'.block().decomment(); // result: "hello world"
`Install
For node with npm:
bash
`
npm install ciment
var comment = require("ciment")
And use with
`
API
$3
javascript
`
comment.decomment(content);
`
Remove the first wrapper comment form this string
$3
javascript
`
comment.single("comment text");
// comment text
`
Return a single line comment string
javascript
`
comment.block("comment text");
/ comment text /
`
Return a normal block comment string
javascript
`
comment.title("comment text");
/ comment text /
`
Return a block comment string like comment title
javascript
`
comment.banner("comment text\nhello world");
/**
* comment text
* hello world
**/
`
Return a banner block comment string
javascript
`
comment.tag("comment text");
`html
`
`
Return a html tag comment string
$3
javascript
`
"comment text".single();
// comment text
`
javascript
`
"comment text".block();
/ comment text /
`
javascript
`
"comment text".title();
/ comment text /
`
javascript
`
"comment text".banner();
/**
* comment text
* hello world
**/
`
javascript
`
"comment text".tag();
`html
``