Nutella with Pepperoni and Mushrooms
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

closest-bower

1.1.4 • Public • Published

closest-bower

dependency Status devDependency Status npm version npm

Find the closest bower.json file meeting specific criteria by searching upwards from a given directory until hitting root.

Based on https://github.com/hughsk/closest-package - Find the closest package.json

Usage

NPM

closest(dir, [filter], found(err, file))

Given a starting directory dir, look up through every directory to see if it contains a bower.json file matching the filter function, for example:

closest(__dirname, function(json, filename) {
  return json.name === 'async'
}, function(err, file) {
  console.log(file)
})

Note that filter is optional and takes the following arguments:

  • json: the parsed bower.json file.
  • filename: the bower.json's absolute filename.

file = closest.sync(dir, [filter])

Same as the closest function, however executed synchronously:

var result = closest.sync(__dirname, function(json, filename) {
  return json.name === 'async'
})
 
console.log(result)

License

MIT. See LICENSE.md for details.

Bitdeli Badge

install

npm i closest-bower

Downloadsweekly downloads

8

version

1.1.4

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability