strip-decorators
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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

Dependencies (0)

    Dev Dependencies (6)

    Package Sidebar

    Install

    npm i strip-decorators

    Weekly Downloads

    0

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    37.4 kB

    Total Files

    17

    Last publish

    Collaborators

    • jfrazier.eth