Install

Requirements

TL;DR: Node 16 or later, NPM 8 or later.

In order to use ts, it is recommended that you are running at least the LTS version of Node, but ts should work on versions as old as 16.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, 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.

Existing Projects

To add ts to an existing project, run:

npm install --save-dev @darkobits/ts

Then, follow the instructions in the Configuration Files section to configure the various tools provided by ts.


New Projects

The easiest way to start a new project using ts is to use the template repository. 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 Configuration Files and Running Scripts sections of the documentation to learn how to use ts effectively.

Last updated