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

nowplaying

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nowplaying - npm Package Compare versions

Comparing version 1.0.6 to 1.1.0

10

example.js
#!/usr/bin/env node
var nowplaying = require("./index.js");
var format = (data) => {
return `[${data.artist} - ${data.name}]`;
}
var time = () => new Date().toTimeString();
nowplaying.on("playing", function (data) {
console.log("PLAYING!", data);
console.log("PLAYING!", format(data), time());
});
nowplaying.on("paused", function (data) {
console.log("PAUSED!", data);
});
console.log("PAUSED!", format(data), time());
});

@@ -9,3 +9,2 @@ #!/usr/bin/env node

this.init();
this.lastEventData = "";
};

@@ -20,11 +19,5 @@

var events = utf8string.replace(/}{/g, "}\0{").split("\0");
events.forEach(function (eventJSON, i) {
var eventData = JSON.parse(eventJSON);
//Dedupe, as Rdio emits duplicate playing or paused events in some cases
if (JSON.stringify(instance.lastEventData) != JSON.stringify(eventData)) {
instance.emit(eventData.playerState.toLowerCase(), eventData);
instance.lastEventData = eventData;
}
instance.emit(eventData.playerState.toLowerCase(), eventData);
})

@@ -31,0 +24,0 @@

{
"name": "nowplaying",
"version": "1.0.6",
"version": "1.1.0",
"description": "Simple node JS event emitter for iTunes/Spotify/Rdio playing/paused events. Wraps Ruby EventMachine Distributed Notification. Mac only.",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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