JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 31
  • Score
    100M100P100Q93859F
  • License MIT

Download PureScript source code from Github

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

NPM version Build Status Build status Coverage Status

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/');
    /* => [
      'LICENSE',
      'Setup.hs',
      'app',
      'bundle',
      'core-tests',
      'license-generator',
      'purescript.cabal',
      'src',
      'stack-ghc-8.0.yaml',
      'stack.yaml',
      'tests'
    ] */
  }
});

Installation

Use npm.

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.'));
✓ LICENSE
✓ Setup.hs
✓ app/
✓ app/Command/
✓ app/Command/Bundle.hs
✓ app/Command/Compile.hs
✓ app/Command/Docs.hs
✓ app/Command/Docs/Ctags.hs
✓ app/Command/Docs/Etags.hs
✓ 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 tar-fs's extract method. Note that:

  • strip option defaults to 1 and can't be changed. That means the top level directory is always stripped off.
  • By default it won't download all *{md,yml} files, some specific files and directories that are unnecessary for building the binary. Pass () => false to the ignore 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: v0.11.3

Specify the commit hash, tag or branch name you want to download.

License

Copyright (c) 2017 Shinnosuke Watanabe

Licensed under the MIT License.