{"_id":"mothership","_rev":"330703","name":"mothership","description":"Helps a module find its package.json mothership.","dist-tags":{"latest":"0.3.0"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"time":{"modified":"2021-06-07T02:46:09.000Z","created":"2014-02-24T22:41:38.427Z","0.3.0":"2014-04-01T20:42:36.945Z","0.2.0":"2014-03-29T16:37:57.876Z","0.1.0":"2014-02-24T22:41:38.427Z"},"users":{"knownasilya":true},"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"repository":{"type":"git","url":"git://github.com/thlorenz/mothership.git"},"versions":{"0.3.0":{"name":"mothership","version":"0.3.0","description":"Helps a module find its package.json mothership.","main":"index.js","scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/thlorenz/mothership.git"},"homepage":"https://github.com/thlorenz/mothership","dependencies":{"find-parent-dir":"~0.3.0"},"devDependencies":{"tap":"~0.4.3"},"keywords":["find","resolve","package.json","condition","predicate","root"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":{"type":"MIT","url":"https://github.com/thlorenz/mothership/blob/master/LICENSE"},"engine":{"node":">=0.6"},"bugs":{"url":"https://github.com/thlorenz/mothership/issues"},"_id":"mothership@0.3.0","dist":{"shasum":"6eddd86a0649f4451f8af1d27c9f63be97bcaf89","size":3833,"noattachment":false,"key":"/mothership/-/mothership-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mothership/download/mothership-0.3.0.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"directories":{},"publish_time":1396384956945,"_cnpm_publish_time":1396384956945,"_hasShrinkwrap":false},"0.2.0":{"name":"mothership","version":"0.2.0","description":"Helps a module find its package.json mothership.","main":"index.js","scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/thlorenz/mothership.git"},"homepage":"https://github.com/thlorenz/mothership","dependencies":{"find-parent-dir":"~0.3.0"},"devDependencies":{"tap":"~0.4.3"},"keywords":["find","resolve","package.json","condition","predicate","root"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":{"type":"MIT","url":"https://github.com/thlorenz/mothership/blob/master/LICENSE"},"engine":{"node":">=0.6"},"bugs":{"url":"https://github.com/thlorenz/mothership/issues"},"_id":"mothership@0.2.0","dist":{"shasum":"93d48a2fbc3e50e2a5fc8ed586f5bc44c65f9a99","size":3315,"noattachment":false,"key":"/mothership/-/mothership-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mothership/download/mothership-0.2.0.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"directories":{},"publish_time":1396111077876,"_cnpm_publish_time":1396111077876,"_hasShrinkwrap":false},"0.1.0":{"name":"mothership","version":"0.1.0","description":"Helps a module find its package.json mothership.","main":"index.js","scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/thlorenz/mothership.git"},"homepage":"https://github.com/thlorenz/mothership","dependencies":{"find-parent-dir":"~0.2.1"},"devDependencies":{"tap":"~0.4.3"},"keywords":["find","resolve","package.json","condition","predicate","root"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":{"type":"MIT","url":"https://github.com/thlorenz/mothership/blob/master/LICENSE"},"engine":{"node":">=0.6"},"bugs":{"url":"https://github.com/thlorenz/mothership/issues"},"_id":"mothership@0.1.0","dist":{"shasum":"b11e8709704f38f149cae842c011cb4a25e6f65b","size":3348,"noattachment":false,"key":"/mothership/-/mothership-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mothership/download/mothership-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"directories":{},"publish_time":1393281698427,"_cnpm_publish_time":1393281698427,"_hasShrinkwrap":false}},"readme":"# mothership [![build status](https://secure.travis-ci.org/thlorenz/mothership.png)](http://travis-ci.org/thlorenz/mothership)\n\nHelps a module find its `package.json` mothership.\n\n```js\nvar mothership = require('mothership')\n  , path = require('path');\n\nmothership(\n    path.join(__dirname, 'uno', 'dos', 'tres')\n  , function ismothership (pack) {\n      return !!(pack.dependencies && pack.dependencies.unodep);\n    }\n  , function (err, res) {\n      if (err) return console.error(err);\n      console.log('first mothership', res.path);  // => [..]/example/uno/package.json\n  }\n)\n\n// Synchronous\nvar res = mothership.sync(\n    path.join(__dirname, 'uno', 'dos', 'tres')\n  , function ismothership (pack) {\n      return !!(pack.dependencies && pack.dependencies.unodep);\n    }\n)      \n\nconsole.log('found mothership', res.path);  // => [..]/example/uno/package.json\n```\n\n## Installation\n\n    npm install mothership\n\n## API\n\n<!-- START docme generated API please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN docme TO UPDATE -->\n\n<div>\n<div class=\"jsdoc-githubify\">\n<section>\n<article>\n<div class=\"container-overview\">\n<dl class=\"details\">\n</dl>\n</div>\n<dl>\n<dt>\n<h4 class=\"name\" id=\"mothership\"><span class=\"type-signature\"></span>mothership<span class=\"signature\">(start, ismothership, cb)</span><span class=\"type-signature\"></span></h4>\n</dt>\n<dd>\n<div class=\"description\">\n<p>Searches upwards from start for package.json files, asking for each if it is the mothership.\nIf a mothership is found it calls back with that.\nIf it reaches the top of the univers it calls back with nothing.</p>\n<h5>mothership result</h5>\n<ul>\n<li><code>path</code>: full path to the <code>package.json</code> that is the mother ship</li>\n<li><code>pack</code>: the <code>package.json</code> object, same that was passed to ismothership</li>\n</ul>\n</div>\n<h5>Parameters:</h5>\n<table class=\"params\">\n<thead>\n<tr>\n<th>Name</th>\n<th>Type</th>\n<th class=\"last\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td class=\"name\"><code>start</code></td>\n<td class=\"type\">\n<span class=\"param-type\">string</span>\n</td>\n<td class=\"description last\"><p>full path at which to start looking for the mothership</p></td>\n</tr>\n<tr>\n<td class=\"name\"><code>ismothership</code></td>\n<td class=\"type\">\n<span class=\"param-type\">function</span>\n</td>\n<td class=\"description last\"><p>invoked with the package object, needs to return true if it is the mothership</p></td>\n</tr>\n<tr>\n<td class=\"name\"><code>cb</code></td>\n<td class=\"type\">\n<span class=\"param-type\">function</span>\n</td>\n<td class=\"description last\"><p>called back with either an error or full path to package.json that is the mothership</p></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"details\">\n<dt class=\"tag-source\">Source:</dt>\n<dd class=\"tag-source\"><ul class=\"dummy\">\n<li>\n<a href=\"https://github.com/thlorenz/mothership/blob/master/index.js\">index.js</a>\n<span>, </span>\n<a href=\"https://github.com/thlorenz/mothership/blob/master/index.js#L8\">lineno 8</a>\n</li>\n</ul></dd>\n</dl>\n</dd>\n<dt>\n<h4 class=\"name\" id=\"mothership::sync\"><span class=\"type-signature\"></span>mothership::sync<span class=\"signature\">(start, ismothership)</span><span class=\"type-signature\"> &rarr; {string}</span></h4>\n</dt>\n<dd>\n<div class=\"description\">\n<p>Synchronous version of mothership.</p>\n</div>\n<h5>Parameters:</h5>\n<table class=\"params\">\n<thead>\n<tr>\n<th>Name</th>\n<th>Type</th>\n<th class=\"last\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td class=\"name\"><code>start</code></td>\n<td class=\"type\">\n<span class=\"param-type\">string</span>\n</td>\n<td class=\"description last\"><p>full path at which to start looking for the mothership</p></td>\n</tr>\n<tr>\n<td class=\"name\"><code>ismothership</code></td>\n<td class=\"type\">\n<span class=\"param-type\">function</span>\n</td>\n<td class=\"description last\"><p>invoked with the package object, needs to return true if it is the mothership</p></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"details\">\n<dt class=\"tag-source\">Source:</dt>\n<dd class=\"tag-source\"><ul class=\"dummy\">\n<li>\n<a href=\"https://github.com/thlorenz/mothership/blob/master/index.js\">index.js</a>\n<span>, </span>\n<a href=\"https://github.com/thlorenz/mothership/blob/master/index.js#L42\">lineno 42</a>\n</li>\n</ul></dd>\n</dl>\n<h5>Returns:</h5>\n<div class=\"param-desc\">\n<p>full path to package.json that is the mothership or <code>null</code> if it wasn't found</p>\n</div>\n<dl>\n<dt>\nType\n</dt>\n<dd>\n<span class=\"param-type\">string</span>\n</dd>\n</dl>\n</dd>\n</dl>\n</article>\n</section>\n</div>\n\n*generated with [docme](https://github.com/thlorenz/docme)*\n</div>\n<!-- END docme generated API please keep comment here to allow auto update -->\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/thlorenz/mothership","bugs":{"url":"https://github.com/thlorenz/mothership/issues"},"license":{"type":"MIT","url":"https://github.com/thlorenz/mothership/blob/master/LICENSE"}}