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

better-package-detector

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

better-package-detector

OSX package detector

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Package Detector

Package detector for OSX. Tells you whether or not a given path is a package based on what's written in the LS Register.

Getting Started

npm install --save better-package-detector

Usage

var pkgDetector = require('better-package-detector');

pkgDetector.init(function () {

  // Returns false if file is not in a package
  // Returns a string of the package path if it is within a package.

  // Examples:
  pkgDetector.findPackage('/path/to/some/file');          // => false
  pkgDetector.findPackage('/path/to/a/package.app/file'); // => '/path/to/a/package.app'
  pkgDetector.findPackage('/path/to/a/package.app');      // => '/path/to/a/package.app'

})

Please note that package detector does not always stat the file to ensure that it's there (for performance reasons, stat-ing every file can be quite expensive on large packages.) So as a result, it's the responsibility of the caller to make sure that the package actually exists. If you do pass a non-existent file path to the package detector it will try its best to determine if it's a package.

Keywords

FAQs

Package last updated on 15 Jul 2016

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