New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

read-pkgs

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read-pkgs

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

latest
Source
npmnpm
Version
1.1.1
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 10 Jun 2018

Did you know?

Socket

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