Install
Last updated
Last updated
TL;DR: Node 20 or later, NPM 8 or later.
In order to use ts
, it is recommended that you are running at least the version of Node, but ts
should work on versions as old as 20.x
.
Secondly, ts
relies on the peer dependency installation strategy of NPM 8 (and later). Peer dependencies are installed at the root of node_modules
, making it possible for ts
to use CLIs (Vite, ESLint, etc.) and for you to import tooling provided by ts
in your own project (Vitest, for example).
Specifically, ts
expects that the package manager being used will automatically install peer dependencies and link their CLIs (if applicable) in the standard node_modules/.bin
directory. You may be able to configure Yarn or PNPM to mimic this behavior but, by default, both of these package managers implement radically different installation strategies that break the above assumptions and make it impossible for ts
to expose executables properly. As such, alternative package managers are not officially supported.
To add ts
to an existing project, run:
Then, follow the instructions in the section to configure the various tools provided by ts
.
The easiest way to start a new project using ts
is to use the . This is a "batteries included" template that contains everything you need to start coding your next project in just a few minutes.
When using the template repository, you will not need to manually create configuration files yourself. However, you should still read through the and sections of the documentation to learn how to use ts
effectively.