Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

closest-bower

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

closest-bower

Find the closest bower.json file meeting specific criteria

  • 1.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package last updated on 18 Jun 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc