Skip to content

rencire/ts-lib-starter

Repository files navigation

typescript lib starter

An opinionated typescript starter project with focus on packaging modern code for ES modules on Browser and NodeJS runtimes.

  • Transpiles Typescript source to ES2018 files.
  • Specifyes type: "module" in package.json to assume all .js files are using ES modules.
    • Can still write commonjs files via .cjs file extension.
    • See docs for more info.
  • Output a type declaration file to lib/main.d.ts.

Prerequisites

  • Git
  • Nixos/Nix (w/ or w/o direnv) OR nvm OR nodjs installed on system.
git clone https://github.com/rencire/ts-lib-starter <your_project_name>
cd <your_project_name>
rm -rf .git

Choose one of the following:

Nixos/Nix + Direnv (preferred):

If you're using nix, and have direnv installed (e.g. nix-env -i direnv), simply cd` into this repo and the correct nodejs version will be installed.

Nixos/Nix

Simply run:

nix-shell

NVM

If you have nvm, a .nvmrc file is provided.

Notes

TODO

Tools