Installation
JSTime ships as a single executable that can be installed a few different ways.
macOS and Linux
Section titled “macOS and Linux”Linux users — The unzip package is required to install JSTime. Kernel version 5.6 or higher is strongly recommended, but the minimum is 5.1.
$ curl -fsSL https://jstime.dev/install | bash # for macOS, Linux, and WSL$ npm install -g jstime # the last `npm` command you'll ever need$ brew tap awfixers-stuff/jstime # for macOS and Linux$ brew install jstime$ docker pull jstime/jstime$ docker run --rm --init --ulimit memlock=-1:-1 jstime/jstime$ proto install jstimeWindows
Section titled “Windows”JSTime provides a limited, experimental native build for Windows. At the moment, only the JSTime runtime is supported.
jstime <file>jstime run <file>
The test runner, package manager, and bundler are still under development. The following commands have been disabled.
jspm install/add/removejspm link/unlinkjstime build
Upgrading
Section titled “Upgrading”Once installed, the binary can upgrade itself.
$ jstime upgradeHomebrew users — To avoid conflicts with Homebrew, use brew upgrade jstime instead.
proto users - Use proto install jstime --pin instead.
JSTime automatically releases an (untested) canary build on every commit to main. To upgrade to the latest canary build:
$ jstime upgrade --canaryTypeScript
Section titled “TypeScript”To install TypeScript definitions for JSTime’s built-in APIs in your project, install jstime-types.
$ jspm add -d jstime-types # dev dependencyThen include "jstime-types" in the compilerOptions.types in your tsconfig.json:
{ "compilerOptions": {+ "types": ["jstime-types"] } }Refer to Ecosystem > TypeScript for a complete guide to TypeScript support in JSTime.
Completions
Section titled “Completions”Shell auto-completion should be configured automatically when JSTime is installed.
If not, run the following command. It uses $SHELL to determine which shell you’re using and writes a completion file to the appropriate place on disk. It’s automatically re-run on every jstime upgrade.
$ jstime completionsTo write the completions to a custom location:
$ jstime completions > path-to-file # write to file$ jstime completions /path/to/directory # write into directory