Skip to content

Strip comments from JavaScript, CSS, HTML, TypeScript, and more via the command line

License

Notifications You must be signed in to change notification settings

prasadrajandran/strip-comments-cli

Repository files navigation

strip-comments-cli

Strip comments from JavaScript, CSS, HTML, TypeScript, and more. This is a CLI wrapper for "strip-comments" by Jon Schlinkert.

Highlights

  • Supports globbing patterns (via your shell):
    • stripcomments ./dist/*.js ./src/*.ts
  • Supports piping:
    • cat source.js | stripcomments
    • cat source.js | stripcomments > source.stripped.js
  • Print results to stdin, overwrite the files, or write the files to a different directory:
    • stripcomments ./src/source.js
    • stripcomments -w ./src/source.js
    • stripcomments -wo ./out ./src/source.js

How Do I Use It?

Have a look at the man page for more information.

Globally

npm i -g @prasadrajandran/strip-comments-cli
stripcomments [OPTION]... [FILE/GLOB]...

Locally

npm i @prasadrajandran/strip-comments-cli
npx stripcomments [OPTION]... [FILE/GLOB]...