An opinionated tool for building a Node.js app and library written in TypeScript.
- Builder / Bundler (
rollupwrapper)-
build-ts app- Bundle TypeScript code as Node.js application
-
build-ts functions- Bundle TypeScript code as GCP/Firebase Functions
- Generate optimized
package.jsonfor Functions
-
build-ts lib- Bundle TypeScript code as Node.js / Pure JavaScript / React Library
- Remove
console.logautomatically
-
- Executor (
ts-nodewrapper)-
build-ts run <TypeScript file>- Run TypeScript code as Node.js script
-
npx build-ts app [project path], e.g.,
npx build-ts app test/fixtures/app-node
# or
cd test/fixtures/app-node && npx build-ts appnpx build-ts functions [project path], e.g.,
npx build-ts app test/fixtures/functions
# or
cd test/fixtures/functions && npx build-ts appnpx build-ts lib [project path], e.g.,
npx build-ts lib test/fixtures/lib
# or
cd test/fixtures/lib && npx build-ts libnpx build-ts lib [project path], e.g.,
npx build-ts lib test/fixtures/lib-react
# or
cd test/fixtures/lib-react && npx build-ts libecho "console.log(process.argv)" > example.ts
npx build-ts run example.ts -- --foo barThe output is like this:
[ '/path/to/node',
'/path/to/build-ts/dist/bin/run.js',
'--foo',
'bar' ]