download-purescript-source v0.6.5
download-purescript-source
A Node.js module to download PureScript source from GitHub
const {readdir} = require('fs').promises;
const downloadPurescript = require('download-purescript-source');
downloadPurescript('./dest/').subscribe({
async complete() {
await readdir('./dest/'); /*=> [
'LICENSE',
'Makefile',
'Setup.hs',
'app',
'bundle',
'core-tests',
'license-generator',
'package.yaml',
'src',
'stack.yaml',
'tests'
] */
}
});Installation
npm install download-purescript-sourceAPI
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 (Kevin Smith'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.remain === 0)
.forEach(({entry}) => console.log(`✓ ${entry.header.path.replace(/^[^/]*\//, '')}`))
.then(() => console.log('\nCompleted.'));✓ LICENSE
✓ Makefile
✓ Setup.hs
✓ app/
✓ app/Command/
✓ app/Command/Bundle.hs
✓ app/Command/Compile.hs
✓ app/Command/Docs.hs
✓ app/Command/Docs/
✓ app/Command/Docs/Html.hs
︙
✓ tests/support/pscide/src/RebuildSpecWithDeps.purs
✓ tests/support/pscide/src/RebuildSpecWithForeign.js
✓ tests/support/pscide/src/RebuildSpecWithForeign.purs
✓ 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 node-tar's Unpack constructor. Note that:
stripoption defaults to1and can't be changed. That means the top level directory is always stripped off.- By default it won't download any
*{md,yml}files, some specific files and directories that are unnecessary for building the binary. Pass() => trueto thefilteroption if you want to download all files included in the archive. onentryoption is not supported.
Additionally, you can use the following:
revision
Type: string
Default: v0.12.5
Specify the commit hash, tag or branch name you want to download.
License
ISC License © 2017 - 2019 Shinnosuke Watanabe
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago