Socket
Socket
Sign inDemoInstall

download-purescript-source

Package Overview
Dependencies
31
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    download-purescript-source

Download PureScript source code from Github


Version published
Weekly downloads
41
decreased by-14.58%
Maintainers
1
Install size
530 kB
Created
Weekly downloads
 

Readme

Source

download-purescript-source

npm version Build Status Coverage Status

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

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 (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:

  • 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 any *{md,yml} files, some specific files and directories that are unnecessary for building the binary. Pass () => true to the filter option if you want to download all files included in the archive.
  • onentry option 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

Keywords

FAQs

Last updated on 20 Apr 2019

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc