1.0.1 • Published 5 years ago

noimport v1.0.1

Weekly downloads
2
License
LGPL-3.0-or-later
Repository
github
Last release
5 years ago

noimport

Utility to resolve ES2015 imports and to remove export statements from a given file. Everything will be mashed up into a flat file.

Works with Javascript and Typescript files.

The current version does no tree shaking and simply patch files together.

Installation

npm install -g noimport

Usage

You can give noimport only the source file as argument to print the result to the console:

noimport source.ts

Or you can specify a target file where to write the result:

noimport source.ts target.ts

Example

Using noimport source.ts on the given files:

source.ts

import { SomeClass } from './other';

export const instance = new SomeClass();

other.ts

export class SomeClass {
    property: string;
}
export class UnusedClass {
    property: string;
}

Will give the following output:

class SomeClass {
    property: string;
}
class UnusedClass {
    property: string;
}

const instance = new SomeClass();