Download a prebuilt PureScript binary
npm install download-purescript


A Node.js module to download a prebuilt PureScript binary
``javascript
const {readdir} = require('fs').promises;
const downloadPurescript = require('download-purescript');
downloadPurescript().subscribe({
async complete() {
(await readdir('.')).includes('purs'); //=> true
}
});
`
``
npm install download-purescript
`javascript`
const downloadPurescript = require('download-purescript');
options: Object Observable
Return: (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.
You can pass options to Request and node-tar's Unpack constructor. Note that:
* strip option defaults to 1 and can't be changed.purs
* All files except for 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:
Specify the version you want to download.
`javascript
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')
}
});
`
Some errors emitted by this function have a peculiar code` property.
The CPU architecture of the currently running operating system is not 64-bit.
No prebuilt binary is provided for the current platform.
ISC License © 2017 - 2019 Shinnosuke Watanabe