Skip to content
Browse files

npm list fix

  • Loading branch information...
1 parent 9c9c740 commit e2f2370d925d562317ba22f354eb130cb24f4298 @contra contra committed
Showing with 8 additions and 4 deletions.
  1. +5 −2 lib/nodester.js
  2. +1 −1 package.json
  3. +2 −1 src/nodester.coffee
View
7 lib/nodester.js
@@ -139,6 +139,9 @@
Nodester.prototype.appnpm_install = function(name, package, cb) {
return this.appnpm_handler(name, package, "install", cb);
};
+ Nodester.prototype.appnpm_list = function(name, cb) {
+ return this.appnpm_handler(name, "", "list", cb);
+ };
Nodester.prototype.appnpm_update = function(name, package, cb) {
return this.appnpm_handler(name, package, "update", cb);
};
@@ -191,10 +194,10 @@
error.code = errCode;
error.message = "Fatal Error! API Response: " + body + "\nReason: " + errCause;
}
- return cb(error, success, {
+ return typeof cb === "function" ? cb(error, success, {
response: body,
errorCode: errCode
- });
+ }) : void 0;
}, this);
};
module.exports.nodester = Nodester;
View
2 package.json
@@ -1,7 +1,7 @@
{
"name":"nodester-api",
"description":"A library to interact with Nodester",
- "version":"0.1.17",
+ "version":"0.1.18",
"homepage":"http://nodester.com/",
"repository":"git://github.com/nodester/nodester-api.git",
"author":"Contra <contra@nodester.com>",
View
3 src/nodester.coffee
@@ -59,6 +59,7 @@ class Nodester
appnpm_handler: (name, package, action, cb) -> @post "appnpm", {appname: name, package: package, action: action}, cb
appnpm_install: (name, package, cb) -> @appnpm_handler name, package, "install", cb
+ appnpm_list: (name, cb) -> @appnpm_handler name, "", "list", cb # TODO: Test
appnpm_update: (name, package, cb) -> @appnpm_handler name, package, "update", cb
appnpm_uninstall: (name, package, cb) -> @appnpm_handler name, package, "uninstall", cb
@@ -85,6 +86,6 @@ handleResponse = (cb) ->
error.code = errCode
error.message = "Fatal Error! API Response: #{ body }\nReason: #{ errCause }"
- cb error, success, {response: body, errorCode: errCode}
+ cb? error, success, {response: body, errorCode: errCode}
module.exports.nodester = Nodester

0 comments on commit e2f2370

Please sign in to comment.
Something went wrong with that request. Please try again.