title
comment-cleaner is a package which removes comments from a string. It is written in TypeScript. Please take a look to the licence before using it.
Prerequisites
This project requires NodeJS (version >= 16.0.0) and NPM. NodeJS and NPM are very easy to install. To make sure you have them available, you can try running the following command:
npm -v && node -v
Installation
npm install comment-cleaner
Quick start
After installation you can import the package with in your JavaScript or TypeScript file:
import { } from 'comment-cleaner/';
To clear the string use the following function:
clean(lang: SupportedLanguages, content: string)
The lang parameter is the name of the language which is your code from. The parameter content is a string that specifies the content from which the comments are to be removed.
The function returns a the cleared string
.
Commands
-
npm run dev
: Starts the TypeScript compiler in watch mode. -
npm run build
: Starts the TypeScript compiler in build mode.
Bug reports
Have you found a bug? Please open an issue.