Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/goto-bus-stop/wrap-comment
- Owner: goto-bus-stop
- License: mit
- Created: 2017-09-07T13:57:47.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-04-19T03:09:26.000Z (over 1 year ago)
- Last Synced: 2024-10-05T16:25:39.414Z (about 1 month ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
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)