read-pkgs
Read `package.json` in directories that match a glob pattern.
Last updated 2 years ago by wtg .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install read-pkgs 
SYNC missed versions from official npm registry.

read-pkgs

Read package.json in directories that match a glob pattern.

Glob a bunch of directories and then run them through read-pkg.

Install

$ yarn add read-pkgs

Usage

const readPkgs = require('read-pkgs');

readPkgs('packages/*').then(pkgs => {
  console.log(pkgs);
  // [{directory: packages/packageOne, pkg: PACKAGEDATA}, {directory: packages/packageTwo, pkg: PACKAGEDATA}]
});

API

readPkgs(patterns, options?)

Returns a Promise resolving to an array of loaded package.json with their given directory.

patterns

  • Type: string Array<string>

A glob pattern or array of glob patterns matching directories that contain a package.json.

options

cwd
  • Type: string
  • Default: process.cwd()

The current working directory in which to search.

normalize
  • Type: boolean
  • Default: true

Whether or not to normalize the package data.

License

MIT © Matthew Fernando Garcia

Current Tags

  • 1.1.1                                ...           latest (2 years ago)

4 Versions

  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (21)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |