Skip to content

Instantly share code, notes, and snippets.

@manguluka
Forked from zkat/index.js
Last active January 13, 2019 20:09
Show Gist options
  • Select an option

  • Save manguluka/57b5ed98b2ca8f3e81c4a97d3a6ec995 to your computer and use it in GitHub Desktop.

Select an option

Save manguluka/57b5ed98b2ca8f3e81c4a97d3a6ec995 to your computer and use it in GitHub Desktop.
npx is cool

Hi!

try passing the URL for this gist to npx.

#!/usr/bin/env node
var nodecast = require('nodecast);
var stream = nodecast.find();
stream.on('device', function(device) {
console.log('Found', device.name);//, device.info);
if (typeof device.apps === 'function') {
device.apps(function(err, apps){
console.log('Applications for', device.name, apps);
});
}
if (typeof device.details === 'function') {
device.details(function(err, details){
console.log('Details for', device.name, details);
});
}
if (typeof device.running === 'function') {
device.running(function(err, app){
console.log('Currently running app for', device.name, app);
});
}
});
{"name": "npx-is-cool", "version": "0.0.0", "bin": "./index.js",
"dependencies":{
"nodecast":"*"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment