$ cnpm install @pnpm/fs.find-packages
Find all packages inside a directory
pnpm add @pnpm/fs.find-packages
const path = require('path')
const findPkgs = require('@pnpm/fs.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] } ]
findPackages(dir, [opts])dirThe directory in which to search for packages.
optsParameters normally passed to glob
opts.patternsArray of globs to use as package locations. For example: ['packages/**', 'utils/**'].
opts.ignorePatterns to ignore when searching for packages. By default: **/node_modules/**, **/bower_components/**, **/test/**, **/tests/**.
MIT © Zoltan Kochan
Copyright 2013 - present © cnpmjs.org | Home |