chromecast-discover
Advanced tools
Comparing version 1.0.0 to 1.0.1
# Changelog | ||
## 0.0.3 - 2017-01-26 | ||
## 1.0.1 - 2017-02-25 | ||
* Convert examples to ES6 (@johnf) | ||
* Move to webpack2 (@johnf) | ||
* Fix bug on discover (@johnf) | ||
## 1.0.0 - 2017-01-26 | ||
* Convert to ES6 (@johnf) | ||
@@ -6,0 +12,0 @@ * Fix API so as to not miss packets (@johnf) |
@@ -1,1 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("debug"),require("events"),require("mdns-js")):"function"==typeof define&&define.amd?define(["debug","events","mdns-js"],t):"object"==typeof exports?exports["chromecast-discover"]=t(require("debug"),require("events"),require("mdns-js")):e["chromecast-discover"]=t(e.debug,e.events,e["mdns-js"])}(this,function(e,t,r){return function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),a=r(3),c=o(a),f=r(2),d=o(f),p=r(1),l=o(p),v=(0,l.default)("chromecast-discover"),y={id:"id",ve:"version",md:"model",ic:"iconPath",fn:"friendlyName",st:"streaming",rs:"appName"},m=function(e){function t(){n(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e.ready=!1;var r=c.default.tcp("googlecast"),o=new c.default.createBrowser(r);return e.browser=o,o.on("ready",function(){v("ready"),e.ready=!0}),o.on("update",function(t){v("update",t);var r=t.type[0];if("googlecast"!==r.name||"tcp"!==r.protocol)return void v("skipped: not a chromecast");if(!t.txt)return void v("skipped: no txt record");var o={host:t.host,addresses:t.addresses,port:t.port,fullname:t.fullname},n=t.txt;n.forEach(function(e){var t=e.match(/^([^=]+)=(.*)$/),r=t[1],n=t[2],i=y[r];i&&(o[i]=n)}),v(o),e.emit("online",o)}),e}return u(t,e),s(t,[{key:"start",value:function(){var e=this;return this.ready?(v("send discover"),void this.browser.discover()):(v("not ready"),void setTimeout(function(){return e.query()},250))}}]),t}(d.default),b=new m;t.default=b,e.exports=t.default},function(t,r){t.exports=e},function(e,t){e.exports=require("events")},function(e,t){e.exports=r}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("debug"),require("events"),require("mdns-js")):"function"==typeof define&&define.amd?define(["debug","events","mdns-js"],t):"object"==typeof exports?exports["chromecast-discover"]=t(require("debug"),require("events"),require("mdns-js")):e["chromecast-discover"]=t(e.debug,e.events,e["mdns-js"])}(this,function(e,t,r){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t){e.exports=require("debug")},function(e,t){e.exports=require("events")},function(e,t){e.exports=require("mdns-js")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(2),a=n(c),f=r(1),d=n(f),p=r(0),l=n(p),v=(0,l.default)("chromecast-discover"),b={id:"id",ve:"version",md:"model",ic:"iconPath",fn:"friendlyName",st:"streaming",rs:"appName"},y=function(e){function t(){o(this,t);var e=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e.ready=!1;var r=a.default.tcp("googlecast"),n=new a.default.createBrowser(r);return e.browser=n,n.on("ready",function(){v("ready"),e.ready=!0}),n.on("update",function(t){v("update",t);var r=t.type[0];if("googlecast"!==r.name||"tcp"!==r.protocol)return void v("skipped: not a chromecast");if(!t.txt)return void v("skipped: no txt record");var n={host:t.host,addresses:t.addresses,port:t.port,fullname:t.fullname},o=t.txt;o.forEach(function(e){var t=e.match(/^([^=]+)=(.*)$/),r=t[1],o=t[2],u=b[r];u&&(n[u]=o)}),v(n),e.emit("online",n)}),e}return i(t,e),s(t,[{key:"start",value:function(){var e=this;return this.ready?(v("send discover"),void this.browser.discover()):(v("not ready"),void setTimeout(function(){return e.start()},250))}}]),t}(d.default),m=new y;t.default=m,e.exports=t.default}])}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "chromecast-discover", | ||
"version": "1.0.0", | ||
"description": "Discover Chromecasts via mdns", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"build": "webpack -p", | ||
"lint": "eslint .", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"author": "John Ferlito <johnf@inodes.org> (http://inodes.org)", | ||
"bugs": { | ||
"url": "https://github.com/johnf/chromecast-discover-node/issues" | ||
}, | ||
"dependencies": { | ||
"debug": "^2.2.0", | ||
"debug": "^2.6.1", | ||
"mdns-js": "^0.5.3" | ||
}, | ||
"description": "Discover Chromecasts via mdns", | ||
"devDependencies": { | ||
"babel-core": "^6.22.1", | ||
"babel-loader": "^6.2.10", | ||
"babel-eslint": "^7.1.1", | ||
"babel-loader": "^6.3.2", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-preset-latest": "^6.22.0", | ||
"eslint": "^3.14.0", | ||
"eslint": "^3.16.1", | ||
"eslint-config-airbnb": "^14.0.0", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-jsx-a11y": "^3.0.2", | ||
"eslint-plugin-react": "^6.9.0", | ||
"json-loader": "^0.5.4", | ||
"path": "^0.12.7", | ||
"webpack": "^1.14.0" | ||
"eslint-plugin-jsx-a11y": "^4.0.0", | ||
"eslint-plugin-react": "^6.10.0", | ||
"webpack": "^2.2.1", | ||
"webpack-node-externals": "^1.5.4" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://git@github.com/johnf/chromecast-discover-node.git" | ||
}, | ||
"homepage": "https://github.com/johnf/chromecast-discover-node#readme", | ||
"keywords": [ | ||
"chromecast" | ||
], | ||
"author": "John Ferlito <johnf@inodes.org> (http://inodes.org)", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/johnf/chromecast-discover-node/issues" | ||
"main": "dist/index.js", | ||
"name": "chromecast-discover", | ||
"repository": { | ||
"type": "git", | ||
"url": "johnf/chromecast-discover-node" | ||
}, | ||
"homepage": "https://github.com/johnf/chromecast-discover-node#readme" | ||
"scripts": { | ||
"build": "webpack -p", | ||
"lint": "eslint .", | ||
"postversion": "git push", | ||
"prepublish": "npm run build", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"version": "vi CHANGELOG.md && git add CHANGELOG.md" | ||
}, | ||
"version": "1.0.1" | ||
} |
@@ -6,3 +6,3 @@ # Chromecast Discover | ||
Discovers Cromecasts via mdns | ||
Discovers Chromecasts via mdns | ||
@@ -18,11 +18,10 @@ ## Installation | ||
``` javascript | ||
import chromecastDiscover from 'chromecast-discover'; | ||
var chromecastDiscover = require('chromecast-discover'); | ||
chromecastDiscover.on('online', (data) => { | ||
console.log('Found chromecast: ', data); | ||
chromecastDiscover.on('online', function(data) { | ||
console.log(data); | ||
}); | ||
// Start querying | ||
chromecastDiscover.start() | ||
chromecastDiscover.start(); | ||
``` | ||
@@ -34,4 +33,10 @@ | ||
To release a new version, update the version number in `package.json`, and then run `npm version major|minor`, which will create a git tag for the version, push git commits and tags. Finally run `npm publish` to push the module file to [npmjs.com](https://npmjs.com). | ||
To release a new version: | ||
* npm test | ||
* npm version major|minor|patch | ||
* npm publish | ||
This will run the tests, update the version, create a git tag for the version, push git commits and tags. Publish the module file to [npmjs.com](https://npmjs.com). | ||
## Contributing | ||
@@ -38,0 +43,0 @@ |
@@ -87,3 +87,3 @@ import mdns from 'mdns-js'; | ||
debug('not ready'); | ||
setTimeout(() => self.query(), 250); | ||
setTimeout(() => self.start(), 250); | ||
return; | ||
@@ -90,0 +90,0 @@ } |
@@ -1,4 +0,6 @@ | ||
var path = require('path'); | ||
var path = require('path'); // eslint-disable-line no-var | ||
var nodeExternals = require('webpack-node-externals'); // eslint-disable-line no-var | ||
module.exports = { | ||
devtool: 'source-map', | ||
entry: './src/index.js', | ||
@@ -12,16 +14,16 @@ target: 'node', | ||
}, | ||
externals: [ | ||
'debug', | ||
'mdns-js', | ||
], | ||
externals: [nodeExternals()], | ||
module: { | ||
loaders: [ | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
loader: 'babel', | ||
enforce: 'pre', | ||
loader: 'eslint-loader', | ||
exclude: /node_modules/, | ||
}, | ||
{ | ||
test: /\.json$/, | ||
loader: 'json-loader', | ||
test: /\.js$/, | ||
loader: 'babel-loader', | ||
exclude: /node_modules/, | ||
}, | ||
@@ -28,0 +30,0 @@ ], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
31787
14
122
46
0
Updateddebug@^2.6.1