nice-registry/npm-tarball-globber

Name: npm-tarball-globber

Owner: nice-registry

Description: null

Created: 2014-09-30 05:58:52.0

Updated: 2017-08-21 15:41:45.0

Pushed: 2016-06-13 05:04:57.0

Homepage: null

Size: 4

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

npm-tarball-globber

Download files within npm packages and load them into memory

Here's what it does:

  1. Fetches npm registry meadata for the given package;
  2. Downloads the most recent tarball to /tmp;
  3. Extracts the tarball to a directory in /tmp;
  4. Synchronously loads all files that match the given glob pattern;
  5. Executes given callback, passing an object with keys as filenames and values as stringified file contents.
Installation

Download node at nodejs.org and install it, if you haven't already.

install npm-tarball-globber --save
Usage
getFiles = require("npm-tarball-globber")

et all the files in the `minimist` package
iles("minimist", function(err, files){
nsole.log(err, Object.keys(files))


se globs to load only the files you need.
ee https://github.com/isaacs/minimatch#usage
iles("npm", "package/html/**/*.html", function(err, files){
nsole.log(err, Object.keys(files))

Tests
install
test
Dependencies
Dev Dependencies
License

MIT

Generated by package-json-to-readme


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.