Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/goto-bus-stop/wrap-comment

Safely wrap some text in a JavaScript comment, escaping close `*/` sequences.
https://github.com/goto-bus-stop/wrap-comment

Last synced: 27 days ago
JSON representation

Safely wrap some text in a JavaScript comment, escaping close `*/` sequences.

Awesome Lists containing this project

README

        

# wrap-comment

Safely wrap some text in a JavaScript comment, escaping close `*/` sequences.

Useful if you're commenting text in some source code.

## Install

```bash
npm install wrap-comment
```

## Usage

```js
var wrapComment = require('wrap-comment')
wrapComment('some text')
// → '/* some text */'
wrapComment('tricky /* text */')
// → '/* tricky /* text *\/ */'
```

## License

[MIT](./LICENSE)