This commit is contained in:
Daniel Odendahl Jr
2017-12-31 23:02:16 +00:00
parent d538875010
commit 7ed6256bbd
+1 -1
View File
@@ -27,7 +27,7 @@ module.exports = class NPMCommand extends Command {
async run(msg, { pkg }) {
try {
const { body } = await snekfetch.get(`https://registry.npmjs.com/${pkg}`);
if (!body.time.unpublished) return msg.say('This package no longer exists.');
if (body.time.unpublished) return msg.say('This package no longer exists.');
const version = body.versions[body['dist-tags'].latest];
const maintainers = trimArray(body.maintainers.map(user => user.name));
const dependencies = version.dependencies ? trimArray(Object.keys(version.dependencies)) : null;