Package Exports
- download-purescript-source
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (download-purescript-source) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
download-purescript-source
A Node.js module to download PureScript source from Github
const {readdirSync} = require('fs');
const downloadPurescript = require('download-purescript-source');
downloadPurescript('./dest/').subscribe({
complete() {
readdirSync('./dest/');
/* => [
'CONTRIBUTING.md',
'CONTRIBUTORS.md',
'INSTALL.md',
'LICENSE',
'README.md',
'Setup.hs',
'app',
...
] */
}
});
Installation
npm install download-purescript-source
API
const downloadPurescriptSource = require('download-purescript-source');
downloadPurescriptSource(dir [, options])
dir: String
(a directory path where the PureScript source will be downloaded)
options: Object
Return: Observable
(zenparsing's implementation)
When the Observable
is subscribed, it starts to download a tar.gz
archive from the PureScript Github repository, extract it and successively send dl-tar's progress
objects to its Observer
.
downloadPurescriptSource('my/dir')
.filter(({entry}) => entry.bytes === entry.header.size)
.forEach(({entry}) => console.log(`✓ ${entry.header.name}`))
.then(() => console.log('\nCompleted.'));
✓ CONTRIBUTING.md
✓ CONTRIBUTORS.md
✓ INSTALL.md
✓ LICENSE
✓ README.md
✓ Setup.hs
✓ app/Command/Bundle.hs
✓ app/Command/Compile.hs
✓ app/Command/Docs.hs
︙
✓ tests/support/pscide/src/RebuildSpecWithHiddenIdent.purs
✓ tests/support/pscide/src/RebuildSpecWithMissingForeign.fail
✓ tests/support/setup-win.cmd
Completed.
Options
You can pass options to Request and tar-fs's extract
method. Note that:
strip
option defaults to1
, not0
. That means the top level directory is stripped off by default.- By default it won't download some files and directories that is unnecessary for building the PureScript binary. Pass
() => false
to theignore
option option if you want to download all files included in the archive. fs
option defaults to graceful-fs for more stability.
Additionally, you can use the following:
revision
Type: String
Default: df9a1d3142f0bad25a025cb7f07d88af164df2c2
Specify the commit hash, tag or branch name you want to download.
License
Copyright (c) 2017 Shinnosuke Watanabe
Licensed under the MIT License.