Socket
Socket
Sign inDemoInstall

ciment

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ciment

Javascript comments library


Version published
Maintainers
1
Created

Readme

Source

ciment

ciment is a library for generating comment-String rapidly. Include javascript, CSS and HTML commnets manipulation.

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:

npm install ciment

And use with var comment = require("ciment")

API

Base function

comment.decomment(content);

Remove the first wrapper comment form this string

Module function

comment.single("comment text");
//  comment text

Return a single line comment string

comment.block("comment text");
/*  comment text  */

Return a normal block comment string

comment.title("comment text");
/*****  comment text  *****/

Return a block comment string like comment title

comment.banner("comment text\nhello world");
/**
*    comment text
*    hello world
**/

Return a banner block comment string

comment.tag("<div>comment text</div>");
<!-- <div>comment text</div> -->

Return a html tag comment string

Prototype function

"comment text".single();
//  comment text
"comment text".block();
/*  comment text  */
"comment text".title();
/*****  comment text  *****/
"comment text".banner();
/**
*    comment text
*    hello world
**/
"<div>comment text</div>".tag();
<!-- <div>comment text</div> -->

Keywords

FAQs

Last updated on 09 Oct 2013

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc