Skip to content

Installation

JSTime ships as a single executable that can be installed a few different ways.

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.

Terminal window
$ curl -fsSL https://jstime.dev/install | bash # for macOS, Linux, and WSL
Terminal window
$ npm install -g jstime # the last `npm` command you'll ever need
Terminal window
$ brew tap awfixers-stuff/jstime # for macOS and Linux
$ brew install jstime
Terminal window
$ docker pull jstime/jstime
$ docker run --rm --init --ulimit memlock=-1:-1 jstime/jstime
Terminal window
$ proto install jstime

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/remove
  • jspm link/unlink
  • jstime build

Once installed, the binary can upgrade itself.

Terminal window
$ jstime upgrade

Homebrew 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:

Terminal window
$ jstime upgrade --canary

View canary build

To install TypeScript definitions for JSTime’s built-in APIs in your project, install jstime-types.

Terminal window
$ jspm add -d jstime-types # dev dependency

Then 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.

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.

Terminal window
$ jstime completions

To write the completions to a custom location:

Terminal window
$ jstime completions > path-to-file # write to file
$ jstime completions /path/to/directory # write into directory