# purescript

> PureScript wrapper that makes it available as a local dependency

Latest version **0.15.16** (published 2026-03-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install purescript
pnpm add purescript
yarn add purescript
bun add purescript
```

Provides the command `purs`.

## Health

**Score 50/100 (C)** — status: stable.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.15.16 |
| Published | 2026-03-15 |
| First published | 2015-03-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 8915 |
| Author | Watanabe Shinnosuke |
| Maintainers | natefaubion, joneshf, kl0tl, goodacre.liam, garyb, hdgarrood, kritzcreek, f-f, purefunctor, thomashoneyman, purescript-npm |
| Keywords | cli, build, install, installation, fallback, purs, purescript, haskell, language, compile, compiler, bin, binary, wrapper |

## Links

- npm: https://www.npmjs.com/package/purescript
- Repository: https://github.com/purescript/purescript
- Issues: https://github.com/purescript/npm-installer/issues
- npm.io page: https://npm.io/package/purescript

## Dependencies (1)

- [purescript-installer](https://npm.io/package/purescript-installer.md) ^0.3.5

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.15.16 (latest) — 2026-03-15
- 0.15.16-8 — 2025-10-18
- 0.15.16-7 — 2025-06-27
- 0.15.16-6 — 2025-06-22
- 0.15.16-5 — 2025-05-14
- 0.15.16-4 — 2024-09-29
- 0.15.16-3 — 2024-07-25
- 0.15.16-2 — 2024-07-24
- 0.15.16-1 — 2024-04-16
- 0.15.16-0 — 2024-02-26
- 0.15.15 — 2024-02-07
- 0.15.15-0 — 2024-02-07
- 0.15.14 — 2024-01-03
- 0.15.14-2 — 2023-12-20
- 0.15.14-1 — 2023-12-14
- … 162 more at https://npm.io/package/purescript/versions

## README

# PureScript npm package

[![npm version](http://img.shields.io/npm/v/purescript.svg)](https://www.npmjs.com/package/purescript)
[![Build Status](https://travis-ci.org/purescript-contrib/node-purescript.svg?branch=master)](https://travis-ci.org/purescript-contrib/node-purescript)

[PureScript](https://github.com/purescript/purescript) binary wrapper that makes it seamlessly available via [npm](https://www.npmjs.com/)

## Prerequisites

This package makes maximum use of `postinstall` [script](https://docs.npmjs.com/misc/scripts), so please make sure that [`ignore-scripts` npm-config](https://docs.npmjs.com/misc/config#ignore-scripts) is not enabled before installation.

```console
$ npm config get ignore-scripts
false
```

## Installation

[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).

```
npm install purescript
```

Once the command above is executed,

__1.__ First, it checks if a PureScript binary has been already cached, and restores that if available.

__2.__ The second plan: if no cache is available, it downloads a prebuilt binary from [the PureScript release page](https://github.com/purescript/purescript/releases).

__3.__ The last resort: if no prebuilt binary is provided for your platform or the downloaded binary doesn't work correctly, it downloads [the PureScript source code](https://github.com/purescript/purescript/tree/master) and compile it with [Stack](https://docs.haskellstack.org/).

## API

### `require('purescript')`

Type: `string`

An absolute path to the installed PureScript binary, which can be used with [`child_process`](https://nodejs.org/api/child_process.html) functions.

```javascript
const {execFile} = require('child_process');
const purs = require('purescript'); //=> '/Users/you/example/node_modules/purescript/purs.bin'

execFile(purs, ['compile', 'input.purs', '--output', 'output.purs'], () => {
  console.log('Compiled.');
});
```

## CLI

You can use it via CLI by installing it [globally](https://docs.npmjs.com/files/folders#global-installation).

```
npm install --global purescript

purs --help
```

## License

[ISC License](./LICENSE) © 2017 - 2019 Watanabe Shinnosuke

---
_Source: https://npm.io/package/purescript · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
