# Install patrun

Add patrun to a JavaScript, TypeScript, or Go project, and check which version you have.

patrun is a library: install it into the project that uses it.

## JavaScript and TypeScript

patrun needs Node.js 24 or later. Install it from npm:

```sh
npm install patrun
```

Load it with `require`, or with `import` in TypeScript or an ES module:

```js
const patrun = require('patrun')

typeof patrun // → 'function'
```

The package has its own types, so TypeScript needs nothing more. See [Use patrun from TypeScript](https://rjrodger.github.io/patrun/how-to/typescript.html).

## Go

The Go port needs Go 1.24 or later. Add it to your module:

```sh
go get github.com/rjrodger/patrun/go
```

Import it under the name `patrun`:

```go
import patrun "github.com/rjrodger/patrun/go"
```

## Check the version

In JavaScript, the version is the package's `version` in `node_modules/patrun/package.json`. In Go, it is the constant `patrun.Version`:

```go
patrun.Version // → 0.4.0
```

The two ports have version numbers of their own, and are released apart. What each release changed is in the changelogs: [`ts/CHANGELOG.md`](https://github.com/rjrodger/patrun/blob/master/ts/CHANGELOG.md) for the npm package and [`go/CHANGELOG.md`](https://github.com/rjrodger/patrun/blob/master/go/CHANGELOG.md) for the Go module.
