Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

Commit

Permalink
Merge pull request #4 from liftsecurity/unpublished
Browse files Browse the repository at this point in the history
404 on unpublished module bc it's really not there imho
  • Loading branch information
Adam Baldwin committed Mar 3, 2015
2 parents eaa66c3 + 76ae024 commit 40a4c2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ function getPackageJson (module, cb) {
return cb(err);
}

if (pkg.time && pkg.time.unpublished) {
var error = new Error('404 - Unpublished module');
error.code = 'E404';
error.pkgid = module.name;

return cb(error);
}

// try to get a version
version = semver.maxSatisfying(keys(pkg.versions), module.version);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "requiresafe-npm",
"version": "2.1.1",
"version": "2.3.0",
"author": "^lift security",
"repository": {
"type": "git",
Expand Down

0 comments on commit 40a4c2f

Please sign in to comment.