Comparing version 0.0.1 to 0.0.2
32
index.js
@@ -10,1 +10,33 @@ // Description: | ||
'use strict'; | ||
const getMessage = (data) => { | ||
switch (data.event) { | ||
case 'package:publish': | ||
return `${data.name}@${data.version} published – https://www.npmjs.com/package/${data.name}`; | ||
} | ||
}; | ||
module.exports = (robot) => { | ||
robot.router.post('/hubot/npm', (req, res) => { | ||
const data = req.body; | ||
let room = req.query.room; | ||
if (!room) { | ||
return res.status(400).end('Missing ?room parameter'); | ||
} | ||
if (room && !/^#/.test(room)) { | ||
room = `#${room}`; | ||
} | ||
const message = getMessage(data); | ||
if (message) { | ||
robot.send({ | ||
room: [room] | ||
}, message); | ||
} | ||
res.end('OK'); | ||
}); | ||
}; |
{ | ||
"name": "hubot-npm", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Hubot script for npm notifications", | ||
@@ -29,4 +29,6 @@ "main": "index.js", | ||
"eslint": "^2.11.1", | ||
"mocha": "^2.5.3" | ||
"lodash": "^4.13.1", | ||
"mocha": "^2.5.3", | ||
"supertest": "^1.2.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
8218
8
221
4