find-packages
TypeScript icon, indicating that this package has built-in type declarations

10.0.4 • Public • Published

find-packages

Find all packages inside a directory

npm version

Installation

pnpm add 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' },
  //      writeProjectManifest: [AsyncFunction] } ]

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

Readme

Keywords

Package Sidebar

Install

npm i find-packages

Weekly Downloads

110,466

Version

10.0.4

License

MIT

Unpacked Size

8.45 kB

Total Files

6

Last publish

Collaborators

  • zkochan
  • pnpmuser