0.3.0 • Published 10 years ago

mothership v0.3.0

Weekly downloads
29,589
License
MIT
Repository
github
Last release
10 years ago

mothership build status

Helps a module find its package.json mothership.

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

mothership(
    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
  }
)

// Synchronous
var res = mothership.sync(
    path.join(__dirname, 'uno', 'dos', 'tres')
  , function ismothership (pack) {
      return !!(pack.dependencies && pack.dependencies.unodep);
    }
)      

console.log('found mothership', res.path);  // => [..]/example/uno/package.json

Installation

npm install mothership

API

generated with docme

License

MIT