0.3.0 • Published 11 years ago
mothership v0.3.0
mothership
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