{"analyzedAt":"2022-07-07T11:38:32.425Z","collected":{"metadata":{"name":"nodecast","scope":"unscoped","version":"1.0.1","description":"Node interface to DIAL/RAMP/ChromeCast","keywords":["google","chromecast","upnp","tv","dial","relaxation","discovery","ramp","youtube","roku","viera","smarttv"],"date":"2018-09-07T15:53:58.886Z","author":{"name":"Fractal","email":"contact@wearefractal.com","url":"http://wearefractal.com/","username":"fractal"},"publisher":{"username":"contra","email":"yo@contra.io"},"maintainers":[{"username":"fractal","email":"contact@wearefractal.com"},{"username":"yocontra","email":"ericbombhax@gmail.com"}],"repository":{"type":"git","url":"git://github.com/contra/nodecast.git"},"links":{"npm":"https://www.npmjs.com/package/nodecast","homepage":"http://github.com/contra/nodecast","repository":"https://github.com/contra/nodecast","bugs":"https://github.com/contra/nodecast/issues"},"license":"MIT","dependencies":{"async":"^2.6.1","node-ssdp":"^3.3.0","optimist":"^0.6.1","require-dir":"^1.0.0","superagent":"^3.8.3","to-array":"^0.1.4","url-join":"^4.0.0","ws":"^6.0.0","xml2json":"^0.11.2"},"devDependencies":{"mocha":"*","should":"*"},"releases":[{"from":"2022-06-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":1},{"from":"2022-04-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":1},{"from":"2022-01-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":1},{"from":"2021-07-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":1},{"from":"2020-07-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":1}],"hasTestScript":true,"readme":"[![NPM version](https://badge.fury.io/js/nodecast.svg)](http://badge.fury.io/js/nodecast)\n\n## Information\n\n<table>\n<tr>\n<td>Package</td><td>nodecast</td>\n</tr>\n<tr>\n<td>Description</td>\n<td>Node interface to DIAL/RAMP/ChromeCast</td>\n</tr>\n<tr>\n<td>Node Version</td>\n<td>>= 0.4</td>\n</tr>\n</table>\n\nThis library fully supports any device that uses the DIAL discovery protocol. Support for custom device functionality is supported in some cases (See Custom Devices section below). This library has been tested with ChromeCast, Roku, and a Panasonic Viera TV. Any device that lets you send YouTube videos to it will have the DIAL protocol.\n\n## Example\n\n```javascript\nvar nodecast = require('nodecast');\n\nvar devices = nodecast.find();\n\ndevices.once('device', function(device) {\n\tvar yt = device.app('YouTube');\n\n\tyt.start('v=12345', function(err) {\n\t\t// starts the app on the device\n\t\t// also optionally takes data to pass to the app\n\t\t// (for example: youtube takes v=id to launch with a video)\n\t});\n});\n```\n\n## Finder(filter)\n\nReturns an EventEmitter that emits all devices on the network. Optional filter to match only certain devices.\n\nExample:\n\n```javascript\nvar network = nodecast.find('chromecast');\n\nnetwork.on('device', function(device){\n\t\n});\n```\n\n### .end()\n\nCancels SSDP search for devices.\n\n## Device\n\n### .is(type)\n\nReturns true or false if the device inherits the custom class of (type).\n\nExample:\n\n```javascript\nvar network = nodecast.find();\n\nnetwork.on('device', function(device){\n\tconsole.log(device.is('roku')); // true\n});\n```\n\n### .app(name)\n\nReturns a reference to an application\n\nExample:\n\n```javascript\nvar network = nodecast.find();\n\nnetwork.on('device', function(device){\n\tvar yt = device.app('YouTube');\n});\n```\n\n## Application\n\n### .info(cb)\n\nCallback is optional. Result data is the parsed XML of whatever the device vendor and application vendor chose to put on their page.\n\nExample:\n\n```javascript\nvar network = nodecast.find();\n\nnetwork.on('device', function(device){\n\tvar yt = device.app('YouTube');\n\n\tyt.info(function(err, info){\n\n\t});\n});\n```\n\n### .start(data, cb)\n\nData and callback are both optional. The format of data may depend on the device or the app you are interfacing with.\n\nExample:\n\n```javascript\nvar network = nodecast.find();\n\nnetwork.on('device', function(device){\n\tvar yt = device.app('YouTube');\n\n\t// all below are valid\n\tyt.start('v=12345', function(err){\n\n\t});\n\n\tyt.start({v:\"12345\"}, function(err){\n\n\t});\n\n\tyt.start(function(err){\n\n\t});\n\n\tyt.start();\n});\n```\n\n### .stop(cb)\n\nCallback is optional. Stops the app. Some devices do not support this.\n\nExample:\n\n```javascript\nvar network = nodecast.find();\n\nnetwork.on('device', function(device){\n\tvar yt = device.app('YouTube');\n\n\t// all below are valid\n\tyt.stop(function(err){\n\n\t});\n\n\tyt.stop();\n});\n```\n\n## Custom Devices\n\nIf you look in `./lib/devices` you can see we have custom support for certain devices. Every vendor has their own spin on DIAL so we try to support the cool stuff they add on top of it. ChromeCast for example, has it's own RAMP protocol. Roku has an interface that lets you emulate a remote. This custom functionality is mixed into the generic DIAL device if support is detected.\n\n## Examples\n\nYou can view more examples in the [example folder.](https://github.com/wearefractal/nodecast/tree/master/examples)\n\n## Testing\n\nTo run the tests you either need to run the ChromeCast emulator locally. Mute your speakers because it will pop up videos and close them.\n\n## LICENSE\n\n(MIT License)\n\nCopyright (c) 2013 Fractal <contact@wearefractal.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."},"npm":{"downloads":[{"from":"2022-07-06T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":0},{"from":"2022-06-30T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":3},{"from":"2022-06-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":28},{"from":"2022-04-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":164},{"from":"2022-01-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":296},{"from":"2021-07-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":647}],"starsCount":2},"github":{"starsCount":158,"forksCount":22,"subscribersCount":21,"issues":{"count":24,"openCount":6,"distribution":{"3600":5,"10800":2,"32400":4,"97200":2,"291600":1,"874800":1,"2624400":0,"7873200":1,"23619600":0,"70858800":1,"212576400":7},"isDisabled":false},"contributors":[{"username":"tmpvar","commitsCount":1},{"username":"yocontra","commitsCount":5},{"username":"amilajack","commitsCount":2},{"username":"klieber","commitsCount":1},{"username":"xaka","commitsCount":1}],"commits":[{"from":"2022-06-30T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":0},{"from":"2022-06-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":0},{"from":"2022-04-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":0},{"from":"2022-01-08T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":0},{"from":"2021-07-07T00:00:00.000Z","to":"2022-07-07T00:00:00.000Z","count":0}]},"source":{"files":{"readmeSize":4591,"testsSize":4163,"hasNpmIgnore":true},"outdatedDependencies":{"xml2json":{"required":"^0.11.2","stable":"0.12.0","latest":"0.12.0"},"node-ssdp":{"required":"^3.3.0","stable":"4.0.1","latest":"4.0.1"},"url-join":{"required":"^4.0.0","stable":"5.0.0","latest":"5.0.0"},"async":{"required":"^2.6.1","stable":"3.2.4","latest":"3.2.4"},"ws":{"required":"^6.0.0","stable":"8.8.0","latest":"8.8.0"},"superagent":{"required":"^3.8.3","stable":"8.0.0","latest":"8.0.0"}}}},"evaluation":{"quality":{"carefulness":0.7899999999999999,"tests":0.6,"health":0.5,"branding":0},"popularity":{"communityInterest":208,"downloadsCount":54.666666666666664,"downloadsAcceleration":-0.24185692541856924,"dependentsCount":0},"maintenance":{"releasesFrequency":0.9,"commitsFrequency":0.9,"openIssues":0.9166666666666667,"issuesDistribution":0.9}},"score":{"final":0.6161825906816799,"detail":{"quality":0.760420428895449,"popularity":0.10884074336719275,"maintenance":0.9998920052415079}}}