New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mothership

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mothership

Helps a module find its package.json mothership.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
30K
increased by16.43%
Maintainers
1
Weekly downloads
 
Created
Source

mothership build status

Helps a module find its package.json mothership.

var findShip = require('mothership')
  , path = require('path');

findShip(
    path.join(__dirname, 'uno', 'dos', 'tres')
  , function ismothership (pack) {
      return !!(pack.dependencies && pack.dependencies.unodep);
    }
  , function (err, res) {
      if (err) return console.error(err);
      console.log('first mothership', res.path);  // => [..]/example/uno/package.json
  }
)

Installation

npm install mothership

API

mothership(start, ismothership, cb)

Searches upwards from start for package.json files, asking for each if it is the mothership. If a mothership is found it calls back with that. If it reaches the top of the univers it calls back with nothing.

mothership result
  • path: full path to the package.json that is the mother ship
  • pack: the package.json object, same that was passed to ismothership
Parameters:
NameTypeDescription
start string

full path at which to start looking for the mothership

ismothership function

invoked with the package object, needs to return true if it is the mothership

cb function

called back with either an error or full path to package.json that is the mothership

Source:

generated with docme

License

MIT

Keywords

FAQs

Package last updated on 24 Feb 2014

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