Socket
Socket
Sign inDemoInstall

closest-bower

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    closest-bower

Find the closest bower.json file meeting specific criteria


Version published
Weekly downloads
4
decreased by-33.33%
Maintainers
1
Install size
22.1 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 18 Jun 2015

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc