Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

wrap-comment

goto-bus-stop52.5kMIT1.0.1

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

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

npm install wrap-comment

Usage

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

License

MIT