strip-decorators
v1.0.3
Published
Small library and CLI tool to strip decorators and unused imports from a TypeScript project. Using the TypeScript compiler API.
Downloads
18
Maintainers
Readme
strip-decorators
Small library and CLI tool to strip decorators and unused imports from a TypeScript project. Using the TypeScript compiler API.
Installation
CLI
Install the CLI version globally:
npm i -g strip-decorators
Usage: strip-decorators <entrypoint> <path to tsconfig>
Example: strip-decorators ./src/index.ts ./tsconfig.json
Library
Install the dev dependency locally:
npm i -D strip-decorators
Usage:
import { compileFromOptions } = from 'strip-decorators';
import * as tsconfig from './tsconfig.json';
(() => {
const entrypoints = ['./src/index.ts'];
compileFromOptions(entrypoints, tsconfig.compilerOptions);
})();
See the example for more details.
Development
$ git clone https://github.com/jfrazier-eth/strip-decorators.git && cd strip-decorators
$ npm install
$ npm run build
References
elide-imports.ts
is copied from the angular CLI