Comparing version 0.0.1 to 0.1.0
@@ -0,3 +1,9 @@ | ||
0.1.0 / 2013-01-29 | ||
------------------ | ||
* Updated dev deps. | ||
* Changed 4 spaces to 2. | ||
* Clean up. | ||
0.0.1 / 2012-08-02 | ||
------------------ | ||
* Initial release |
@@ -5,35 +5,31 @@ var fs = require('fs') | ||
if (typeof fs.existsSync === 'undefined'){ | ||
fs.existsSync = path.existsSync; //make Node v0.4 -> v0.8 compatible | ||
} | ||
if (typeof fs.existsSync === 'undefined') | ||
fs.existsSync = path.existsSync; //make Node v0.4 -> v0.8 compatible | ||
function packageFind(paths) { | ||
var foundDir = null, dir = null; | ||
if (!paths) return null; | ||
if (paths) { | ||
for (var i = 0; i < paths.length; ++i){ | ||
dir = path.dirname(paths[i]); | ||
if (fs.existsSync(path.join(dir, 'package.json'))){ | ||
foundDir = dir; | ||
break; | ||
} | ||
} | ||
} | ||
return foundDir; | ||
for (var i = 0; i < paths.length; ++i){ | ||
var dir = path.dirname(paths[i]); | ||
if (fs.existsSync(path.join(dir, 'package.json'))) | ||
return dir; | ||
} | ||
return null; | ||
} | ||
module.exports.self = function() { | ||
if (selfModule) | ||
return packageFind(selfModule.paths); | ||
else | ||
return null; | ||
if (selfModule) | ||
return packageFind(selfModule.paths); | ||
else | ||
return null; | ||
} | ||
module.exports.parent = function() { | ||
if (selfModule.parent) | ||
return packageFind(selfModule.parent.paths); | ||
else | ||
return null; | ||
if (selfModule.parent) | ||
return packageFind(selfModule.parent.paths); | ||
else | ||
return null | ||
} | ||
{ | ||
"name" : "packpath", | ||
"version" : "0.0.1", | ||
"description" : "Find the path(s) package.json.", | ||
"homepage" : [ | ||
"https://github.com/jprichardson/node-packpath" | ||
], | ||
"repository" : { | ||
"type" : "git", | ||
"url" : "https://github.com/jprichardson/node-packpath" | ||
}, | ||
"keywords" : ["require", "package", "path", "resolve", "package.json"], | ||
"author" : "JP Richardson <jprichardson@gmail.com>", | ||
"licenses" : [ { | ||
"type" : "MIT", | ||
"url" : "http://github.com/jprichardson/node-packpath/raw/master/LICENSE" | ||
}], | ||
"devDepdencies":{ | ||
"mocha": "1.3.x" | ||
}, | ||
"main" : "./lib/packpath", | ||
"scripts": { | ||
"test": "mocha test" | ||
"name": "packpath", | ||
"version": "0.1.0", | ||
"description": "Find the path(s) package.json.", | ||
"homepage": [ | ||
"https://github.com/jprichardson/node-packpath" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/jprichardson/node-packpath" | ||
}, | ||
"keywords": [ | ||
"require", | ||
"package", | ||
"path", | ||
"resolve", | ||
"package.json", | ||
"find" | ||
], | ||
"author": "JP Richardson <jprichardson@gmail.com>", | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "http://github.com/jprichardson/node-packpath/raw/master/LICENSE" | ||
} | ||
} | ||
], | ||
"devDepdencies": { | ||
"mocha": "*" | ||
}, | ||
"main": "./lib/packpath", | ||
"scripts": { | ||
"test": "mocha test" | ||
}, | ||
"devDependencies": { | ||
"testutil": "~0.4.0" | ||
} | ||
} |
@@ -1,23 +0,21 @@ | ||
var assert = require('assert'); | ||
var faux_module_parent = require('faux-module-parent'); | ||
var testutil = require('testutil') | ||
, faux_module_parent = require('faux-module-parent'); | ||
var T = function(expr) { assert(expr); } | ||
describe('packpath', function(){ | ||
describe('+ self()', function(){ | ||
it('should return the directory of the package.json for faux-module-self', function(){ | ||
//console.log(faux_module_parent.self()); | ||
//console.log(faux_module_parent.selfFromPackPath()); | ||
T(faux_module_parent.self() === faux_module_parent.selfFromPackPath()); | ||
}); | ||
}); | ||
describe('+ self()', function(){ | ||
it('should return the directory of the package.json for faux-module-self', function(){ | ||
//console.log(faux_module_parent.self()); | ||
//console.log(faux_module_parent.selfFromPackPath()); | ||
EQ (faux_module_parent.self(), faux_module_parent.selfFromPackPath()) | ||
}) | ||
}) | ||
describe('+ parent()', function(){ | ||
it('should return the directory of the package.json for faux-module-parent', function(){ | ||
//console.log(faux_module_parent.parent()); | ||
//console.log(faux_module_parent.parentFromPackPath()); | ||
T(faux_module_parent.parent() === faux_module_parent.parentFromPackPath()); | ||
}); | ||
}); | ||
}); | ||
describe('+ parent()', function(){ | ||
it('should return the directory of the package.json for faux-module-parent', function(){ | ||
//console.log(faux_module_parent.parent()); | ||
//console.log(faux_module_parent.parentFromPackPath()); | ||
EQ (faux_module_parent.parent(), faux_module_parent.parentFromPackPath()) | ||
}) | ||
}) | ||
}) |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
5815
12
71
0
1
1