strip-comments
strip-comments copied to clipboard
Strip block comments or line comments from JavaScript code.
`/* this comment is not stripped */`
``` strip("let something = 'https://example.com';"); ``` Expected output: > let something = 'https://example.com'; Fact output: > let something = 'https:
In JavaScript / TypeScript, this package will strip not just the block comment but the entire remainder of the string when a block comment of the form `/**/` is encountered....
CLI
Hello thanks for your project! It would be awesome if strip-comments have CLI mode. Like this: ```js const strip = require('strip-comments') const fs = require('fs') fs.writeFileSync(process.argv[3] || process.stdout.fd, strip(fs.readFileSync(process.argv[2] ||...
If I include a `/*` within one of my comments, `strip-comments` incorrectly removes everything after it in the file: ```js const strip = require('strip-comments'); console.log(strip(` export interface A { b:...
# Remove all whitespace related to comments ## Source code: ``` js const obj = { // Here are some code comments name: `js`, /** * Here are some code...
Hey there! I'd like to report a security issue but cannot find contact instructions on your repository. If not a hassle, might you kindly add a `SECURITY.md` file with an...
Hi friend. I got in trouble. ``` js 'use strict'; const strip = require('strip-comments'); // its ok if different quotes const str = strip("var s1= '';//empty quotes not the same...