Skip to content
This repository has been archived by the owner. It is now read-only.
Find all packages inside a directory
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
test
typings
.gitattributes
.gitignore
.npmrc
.travis.yml
LICENSE
README.md
example.js
package.json
pnpm-lock.yaml
renovate.json
tsconfig.json
tslint.json

README.md

this package is moved to the pnpm repo

find-packages

Find all packages inside a directory

npm version Build Status

Installation

npm i -S find-packages

Usage

const path = require('path')
const findPkgs = require('find-packages')

findPkgs(path.join(__dirname, 'test', 'fixture'))
  .then(pkgs => console.log(pkgs))
  .catch(err => console.error(err))
  //> [ { path: '/home/zkochan/src/find-packages/test/fixture/pkg',
  //      manifest: { name: 'foo', version: '1.0.0' } } ]

API

findPackages(dir, [opts])

dir

The directory in which to search for packages.

opts

Parameters normally passed to glob

opts.patterns

Array of globs to use as package locations. For example: ['packages/**', 'utils/**'].

opts.ignore

Patterns to ignore when searching for packages. By default: **/node_modules/**, **/bower_components/**, **/test/**, **/tests/**.

License

MIT © Zoltan Kochan

You can’t perform that action at this time.