
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
install-purescript
Advanced tools
Install PureScript to a given directory
cconst {execFile} = require('child_process');
const installPurescript = require('install-purescript');
installPurescript({version: '0.13.0'}).subscribe({
next(event) {
if (event.id === 'search-cache' && event.found) {
console.log('✓ Found a cache.');
return;
}
if (event.id === 'restore-cache:complete') {
console.log('✓ Cached binary restored.');
return;
}
if (event.id === 'check-binary:complete') {
console.log('✓ Binary works correctly.');
return;
}
}
complete() {
execFile('./purs', ['--version'], (err, stdout) => {
stdout.toString(); //=> '0.13.0\n'
});
}
});
npm install install-purescript
const installPurescript = require('install-purescript');
options: Object
Return: Observable (Kevin Smith's implementation)
When the Observable is subscribed,
while successively sending events to its Observer.
Every event object has id property with one of these values:
search-cacherestore-cacherestore-cache:failrestore-cache:completecheck-binarycheck-binary:failcheck-binary:completeheadhead:failhead:completedownload-binarydownload-binary:faildownload-binary:completecheck-stackcheck-stack:completedownload-sourcedownload-source:completesetupsetup:completebuildbuild:completewrite-cachewrite-cache:failwrite-cache:complete |
search-cache -- x -+- head ------------ x -+- check-stack ----- x -+
| | | | | |
o | o | o |
| | | | | |
restore-cache - x -+ download-binary - x -+ download-source - x -+
| | | | | |
o | o | o |
| | | | | |
check-binary -- x -+ check-binary ---- x -+ setup ----------- x -+
| | | |
o | o |
| | | |
| | build ----------- x -+
| | | |
| o o |
| | | |
******************* ***************** ***************** ^^^^^^^
Restored a Downloaded a Built a binary Error
binary from cache prebuilt binary from the source ^^^^^^^
******************* ***************** *****************
| |
write-cache write-cache
search-cacheFires when it checks if a tgz archive of the required PureScript binary exists in the cache directory.
{
id: 'search-cache',
path: <string>, // path to the cache file
found: <boolean> // whether a cache is found or not
}
restore-cacheFires when it starts to extract a binary from the cached tgz archive.
{
id: 'restore-cache'
}
restore-cache:failFires when it fails to restore the binary from cache.
{
id: 'restore-cache:fail',
error: <Error>
}
restore-cache:completeFires when the cached binary is successfully restored.
{
id: 'restore-cache:complete'
}
check-binaryFires when it starts to verify the cached or downloaded binary works correctly, by running purs --version.
{
id: 'check-binary'
}
check-binary:failFires when the cached or downloaded binary doesn't work correctly.
{
id: 'check-binary:fail',
error: <Error>
}
check-binary:completeFires when it verifies the cached or downloaded binary works correctly.
{
id: 'check-binary:complete'
}
head head:fail head:complete download-binary download-binary:fail download-binary:complete check-stack check-stack:complete download-source download-source:completeInherited from download-or-build-purescript.
setup setup:complete build build:completeInherited from build-purescript.
write-cacheFires when it starts to create a cache. The cache is compressed with Brotli.
{
id: 'write-cache',
originalSize: <integer> // the size of the binary before compression in bytes
}
write-cache:failFires when it fails to create the cache.
{
id: 'write-cache:fail',
error: <Error>
}
write-cache:completeFires when the cache is successfully created.
{
id: 'write-cache:complete'
}
Every error passed to the Observer has id property that indicates which step the error occurred at.
// When the `stack` command is not installed
installPurescript('.').subscribe({
error(err) {
err.message; //=> '`stack` command is not found in your PATH ...'
err.id; //=> 'check-stack'
}
});
// When your machine lose the internet connection while downloading the source
installPurescript('.').subscribe({
error(err) {
err.message; //=> 'socket hang up'
err.id; //=> 'download-source'
}
});
Options are directly passed to download-or-build-purescript.
Additionally, you can use the following:
Type: boolean
Default: false
Force reinstalling a binary even if an appropriate cache already exists.
ISC License © 2017 - 2019 Watanabe Shinnosuke
FAQs
Install PureScript to a given directory
The npm package install-purescript receives a total of 131 weekly downloads. As such, install-purescript popularity was classified as not popular.
We found that install-purescript demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.