You can present the project as an npm package by following these steps:
1) Create an index.ts that will export all the necessary classes:
export * from "./lib/Helper"; export * from "./lib/Log"; // .... export * from "./lib/Query";
2) Make shure, you pass the ts file with the declarations flag, so you will get a nice d.ts file nearby.
3) In your package.json, specify transpiled index.js and index.d.ts, as in the example below:
"main": "dist/index.js", "typings": "typings/index.d.ts",
4) Publish your submitted sources with definitions in NPM.
After these steps, you can access your package as follows:
import * as MyLib from 'MyLib'; let h = new MyLib.Helper();
As an example, you can check out the project here .
source share