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.

Revisions

  1. manguluka revised this gist Jan 13, 2019. 2 changed files with 26 additions and 2 deletions.
    22 changes: 21 additions & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,23 @@
    #!/usr/bin/env node

    console.log('yay gist')
    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);
    });
    }
    });
    6 changes: 5 additions & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -1 +1,5 @@
    {"name": "npx-is-cool", "version": "0.0.0", "bin": "./index.js"}
    {"name": "npx-is-cool", "version": "0.0.0", "bin": "./index.js",
    "dependencies":{
    "nodecast":"*"
    }
    }
  2. @zkat zkat revised this gist Jun 27, 2017. 3 changed files with 4 additions and 4 deletions.
    3 changes: 0 additions & 3 deletions bin.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +0,0 @@
    #!/bin/bash

    echo "This is actual bash code I'm running here lol"
    3 changes: 3 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    #!/usr/bin/env node

    console.log('yay gist')
    2 changes: 1 addition & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    {"name": "npx-is-cool", "version": "0.0.0", "bin": "./bin.sh"}
    {"name": "npx-is-cool", "version": "0.0.0", "bin": "./index.js"}
  3. @zkat zkat revised this gist Jun 27, 2017. 3 changed files with 4 additions and 3 deletions.
    3 changes: 3 additions & 0 deletions bin.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    #!/bin/bash

    echo "This is actual bash code I'm running here lol"
    2 changes: 0 additions & 2 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -1,2 +0,0 @@
    #!/usr/bin/env node
    console.log('this code was executed straight off a gist')
    2 changes: 1 addition & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    {"name": "npx-is-cool", "version": "0.0.0", "bin": "./index.js"}
    {"name": "npx-is-cool", "version": "0.0.0", "bin": "./bin.sh"}
  4. @zkat zkat revised this gist Jun 27, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -1 +1,2 @@
    #!/usr/bin/env node
    console.log('this code was executed straight off a gist')
  5. @zkat zkat created this gist Jun 27, 2017.
    1 change: 1 addition & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    console.log('this code was executed straight off a gist')
    1 change: 1 addition & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    {"name": "npx-is-cool", "version": "0.0.0", "bin": "./index.js"}
    3 changes: 3 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    Hi!

    try passing the URL for this gist to `npx`.