Skip to content

Commit 1a47fd4

Browse files
authoredNov 7, 2016
Merge pull request #6 from npm-janitor/added-description
Added description for modules
2 parents 4b5dae8 + 00be960 commit 1a47fd4

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed
 

‎index.js

+18-17
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,23 @@ var PJV = require('package-json-validator').PJV;
55
var asyncMap = require('async').map
66

77
module.exports = function (username, cb) {
8-
if (typeof username !== 'string') {
9-
throw new TypeError('Expected a string');
10-
}
11-
registry.user(username).list( function (err,modules) {
12-
asyncMap(modules, function(module, callback) {
13-
packageJson(module, 'latest', function (err, json) {
14-
if (err) return callback(err);
15-
callback(null, {
16-
module: module,
17-
homepage: json.homepage,
18-
info : PJV.validate(JSON.stringify(json), "npm", {warnings: true, recommendations: true})
19-
});
20-
})
21-
}, function(err, results) {
22-
cb(err, results);
23-
});
24-
});
8+
if (typeof username !== 'string') {
9+
throw new TypeError('Expected a string');
10+
}
11+
registry.user(username).list( function (err,modules) {
12+
asyncMap(modules, function(module, callback) {
13+
packageJson(module, 'latest', function (err, json) {
14+
if (err) return callback(err);
15+
callback(null, {
16+
module: module,
17+
homepage: json.homepage,
18+
description: json.description,
19+
info : PJV.validate(JSON.stringify(json), "npm", {warnings: true, recommendations: true})
20+
});
21+
})
22+
}, function(err, results) {
23+
cb(err, results);
24+
});
25+
});
2526
};
2627

0 commit comments

Comments
 (0)
Please sign in to comment.