Animated emoji, npm fix

This commit is contained in:
Daniel Odendahl Jr
2017-12-31 22:48:48 +00:00
parent d2e9bfbf3e
commit 0933c8f318
6 changed files with 24 additions and 9 deletions
+1
View File
@@ -27,6 +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.');
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;