replace-comments-x

3.1.2 • Public • Published

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

replace-comments-x

Replace the comments in a string.

module.exports(string, [replacement])string

This method replaces comments in a string.

Kind: Exported function
Returns: string - The new string with the comments replaced.
Throws:

  • TypeError If string is null or undefined or not coercible.
  • TypeError If replacement is not coercible.
Param Type Description
string string The string to be stripped.
[replacement] string The string to be used as a replacement.

Example

import replaceComments from 'replace-comments-x';
 
console.log(replaceComments('test; /* test */', '')); // 'test;'
console.log(replaceComments('test; // test', '')); // 'test;'

Package Sidebar

Install

npm i replace-comments-x

Weekly Downloads

6,329

Version

3.1.2

License

MIT

Unpacked Size

118 kB

Total Files

11

Last publish

Collaborators

  • xotic750