This is a template project that demonstrates how to distribute executable TypeScript snippets on npmjs.org without compilation to JavaScript, thanks to the ts-node shebang line:
#/usr/bin/env ts-node
- fork this project or click Use this template,
- replace
index.ts
etc. with your own script, - rename this project to something else other than
@btwiuse/ts-node-shebang
, - run
yarn npm login
to login to npm. - run
yarn publish
to publish it. - visit https://unpkg.com/browse/@btwiuse/ts-node-shebang/ to confirm your script/assets are included in the package.
So people can easily install your script,
$ npm install -g ts-node @btwiuse/ts-node-shebang
and run it:
$ btwiuse-ts-node-shebang