New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

random-puppy

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

random-puppy - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

20

index.js

@@ -23,3 +23,3 @@ 'use strict';

module.exports = function (subreddit) {
function randomPuppy(subreddit) {
subreddit = (typeof subreddit === 'string' && subreddit.length !== 0) ? subreddit : 'puppies';

@@ -34,2 +34,20 @@

.then(getRandomImage => formatResult(getRandomImage));
}
function callback(subreddit, cb) {
randomPuppy(subreddit)
.then(url => cb(null, url))
.catch(err => cb(err));
}
// subreddit is optional
// callback support is provided for a training exercise
module.exports = (subreddit, cb) => {
if (typeof cb === 'function') {
callback(subreddit, cb);
} else if (typeof subreddit === 'function') {
callback(null, subreddit);
} else {
return randomPuppy(subreddit);
}
};

9

package.json
{
"name": "random-puppy",
"version": "1.0.0",
"version": "1.0.1",
"description": "Get a random puppy image url.",

@@ -22,3 +22,8 @@ "license": "MIT",

"keywords": [
"puppy", "doggie", "dog", "imgur", "random", "placeholder"
"puppy",
"doggie",
"dog",
"imgur",
"random",
"placeholder"
],

@@ -25,0 +30,0 @@ "dependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc