0.8.5 • Published 5 years ago

download-purescript v0.8.5

Weekly downloads
600
License
ISC
Repository
github
Last release
5 years ago

download-purescript

npm version Build Status Coverage Status

A Node.js module to download a prebuilt PureScript binary

const {readdir} = require('fs').promises;
const downloadPurescript = require('download-purescript');

downloadPurescript().subscribe({
  async complete() {
    (await readdir('.')).includes('purs'); //=> true
  }
});

Installation

Use npm.

npm install download-purescript

API

const downloadPurescript = require('download-purescript');

downloadPurescript(options)

options: Object
Return: Observable (Kevin Smith's implementation)

When the Observable is subscribed, it starts to download a tar.gz archive of a PureScript binary for the current platform from the release page, extract it to the current working directory and successively send dl-tar's progress objects to its Observer.

Options

You can pass options to Request and node-tar's Unpack constructor. Note that:

  • strip option defaults to 1 and can't be changed.
  • All files except for purs and purs.exe, for example README, won't be downloaded by default. Pass () => true to filter option if you want to download all files included in the archive.
  • followRedirect option defaults to true and cannot be disabled.

Additionally, you can use the following:

version

Type: string
Default: 0.12.5

Specify the version you want to download.

const {execFileSync} = require('child_process');

downloadPurescript({version: '0.12.4'}).subscribe({
  complete() {
    execFileSync('./purs', ['--version'], {encoding: 'utf8'}).trim(); //=> '0.12.4' (not '0.12.5')
  }
});

Error codes

Some errors emitted by this function have a peculiar code property.

ERR_UNSUPPORTED_ARCH

The CPU architecture of the currently running operating system is not 64-bit.

ERR_UNSUPPORTED_PLATFORM

No prebuilt binary is provided for the current platform.

License

ISC License © 2017 - 2019 Shinnosuke Watanabe

0.8.5

5 years ago

0.8.4

5 years ago

0.8.3

5 years ago

0.8.2

5 years ago

0.8.1

5 years ago

0.8.0

5 years ago

0.7.0

5 years ago

0.7.0-1

5 years ago

0.7.0-0

5 years ago

0.6.0

6 years ago

0.5.0

6 years ago

0.5.0-0

6 years ago

0.4.1

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.4.0

6 years ago

0.4.0-1

6 years ago

0.4.0-0

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.3.0-5

7 years ago

0.3.0-4

7 years ago

0.3.0-3

7 years ago

0.3.0-2

7 years ago

0.3.0-1

7 years ago

0.3.0-0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.0

7 years ago