blob: 4cae658e439a6da2690dfbd17a49d41ea5efe40b [file] [log] [blame]
{
"name": "node-firefox-find-ports",
"version": "1.2.0",
"description": "Find ports where debuggable runtimes are listening",
"main": "index.js",
"dependencies": {
"adbkit": "^2.1.6",
"es6-promise": "^2.0.1",
"firefox-client": "^0.3.0",
"shelljs": "^0.3.0"
},
"devDependencies": {
"gulp": "^3.8.10",
"gulp-jscs": "^1.3.1",
"gulp-jshint": "^1.9.0",
"gulp-json-lint": "0.0.1",
"gulp-nodeunit": "0.0.5",
"gulp-replace": "^0.5.0",
"jshint-stylish": "^1.0.0",
"mockery": "^1.4.0",
"node-firefox-build-tools": "^0.1.0",
"nodemock": "^0.3.4"
},
"scripts": {
"gulp": "gulp",
"test": "gulp test"
},
"repository": {
"type": "git",
"url": "https://github.com/mozilla/node-firefox-find-ports.git"
},
"keywords": [
"firefox",
"developer tools",
"b2g",
"firefox os",
"firefoxos",
"fxos",
"ports"
],
"author": {
"name": "Mozilla",
"url": "https://mozilla.org/"
},
"contributors": [
{
"name": "Nicola Greco",
"email": "me@nicola.io",
"url": "http://nicolagreco.com/"
},
{
"name": "Soledad Penadés",
"email": "listas@soledadpenades.com",
"url": "http://soledadpenades.com/"
},
{
"name": "Matthew R. MacPherson",
"email": "matt@lonelyvegan.com",
"url": "http://tofumatt.com/"
}
],
"license": "Apache 2.0",
"bugs": {
"url": "https://github.com/mozilla/node-firefox-find-ports/issues"
},
"homepage": "https://github.com/mozilla/node-firefox-find-ports",
"readme": "# node-firefox-find-ports [![Build Status](https://secure.travis-ci.org/mozilla/node-firefox-find-ports.png?branch=master)](http://travis-ci.org/mozilla/node-firefox-find-ports)\n\n> Find ports where debuggable runtimes are listening.\n\n[![Install with NPM](https://nodei.co/npm/node-firefox-find-ports.png?downloads=true&stars=true)](https://nodei.co/npm/node-firefox-find-ports/)\n\nThis is part of the [node-firefox](https://github.com/mozilla/node-firefox) project.\n\nWhen runtimes have remote debugging enabled, they start a server that listens\nfor incoming connections. Devices connected via USB can also have their remote\ndebugging sockets forwarded to local TCP/IP ports by the Android Debug Bridge\n(adb). \n \nThis module can find these runtimes and in which port they are listening.\n\n## Installation\n\n### From git\n\n```bash\ngit clone https://github.com/mozilla/node-firefox-find-ports.git\ncd node-firefox-find-ports\nnpm install\n```\n\nIf you want to update later on:\n\n```bash\ncd node-firefox-find-ports\ngit pull origin master\nnpm install\n```\n\n### npm\n\n```bash\nnpm install node-firefox-find-ports\n```\n\n## Usage\n\n```javascript\nfindPorts(options) // returns a Promise\n```\n\nwhere `options` is a plain Object with any of the following:\n\n* `firefox`: look for Firefox Desktop instances\n* `firefoxOSSimulator`: look for Firefox OS Simulators\n* `firefoxOSDevice`: look for local ports forwarded to connected devices\n* `ignoreMultiplePortsPerDevice`: if there are multiple local ports forwarded to the same remote debugging port on a device, report only the first that is found (default: `true`)\n* `detailed`: query each found runtime for more information, such as the version, build time, processor, etc. The additional data will be added to the entry under a new `device` field.\n\nIf no `options` are provided, or if `options` is an empty `Object` (`{}`), then `findPorts` will look for any runtimes, of any type.\n\n### Finding ports\n\n```javascript\nvar findPorts = require('node-firefox-find-ports');\n\n// Return all listening runtimes\nfindPorts().then(function(results) {\n console.log(results);\n});\n\n// Returns only Firefox OS simulators, this time with error handling\nfindPorts({ firefoxOSSimulator: true }).then(function(results) {\n console.log(results);\n}, function(err) {\n console.log(err);\n});\n```\n\nThe output from the above code might look like the following:\n```javascript\n[ { type: 'b2g', port: 56567, pid: 45876 },\n { type: 'firefox', port: 6000, pid: 3718 },\n { type: 'device', port: 8001, deviceId: '3739ced5' } ]\n```\n\nUse the `detailed` option for additional information:\n```javascript\n// Returns only Firefox OS simulators, with extra detailed output\nfindPorts({\n firefoxOSSimulator: true, \n firefoxOSDevice: true,\n detailed: true\n}).then(function(results) {\n console.log(results);\n});\n```\n\nDetailed output includes a lot more info:\n```javascript\n[ { type: 'b2g',\n port: 56567,\n pid: 45876,\n device:\n { appid: '{3c2e2abc-06d4-11e1-ac3b-374f68613e61}',\n apptype: 'b2g',\n vendor: 'Mozilla',\n name: 'B2G',\n version: '2.2.0.0-prerelease',\n appbuildid: '20141123160201',\n platformbuildid: '20141123160201',\n platformversion: '36.0a1',\n geckobuildid: '20141123160201',\n geckoversion: '36.0a1',\n changeset: '8c02f3280d0c',\n useragent: 'Mozilla/5.0 (Mobile; rv:36.0) Gecko/20100101 Firefox/36.0',\n locale: 'en-US',\n os: 'B2G',\n hardware: null,\n processor: 'x86_64',\n compiler: 'gcc3',\n dpi: 258,\n brandName: null,\n channel: 'default',\n profile: 'profile',\n width: 1680,\n height: 1050 },\n release: '2.2.0.0-prerelease' },\n { type: 'device',\n port: 8001,\n deviceId: '3739ced5',\n device:\n { appid: '{3c2e2abc-06d4-11e1-ac3b-374f68613e61}',\n apptype: 'b2g',\n vendor: 'Mozilla',\n name: 'B2G',\n version: '3.0.0.0-prerelease',\n appbuildid: '20150320064705',\n platformbuildid: '20150320064705',\n platformversion: '39.0a1',\n geckobuildid: '20150320064705',\n geckoversion: '39.0a1',\n changeset: 'b2e71f32548f',\n locale: 'en-US',\n os: 'B2G',\n hardware: 'qcom',\n processor: 'arm',\n compiler: 'eabi',\n brandName: null,\n channel: 'nightly',\n profile: 'default',\n dpi: 254,\n useragent: 'Mozilla/5.0 (Mobile; rv:39.0) Gecko/39.0 Firefox/39.0',\n width: 320,\n height: 569 },\n release: '3.0.0.0-prerelease' } ]\n```\n\n## Running the tests\n\nAfter installing, you can simply run the following from the module folder:\n\n```bash\nnpm test\n```\n\nTo add a new unit test file, create a new file in the `tests/unit` folder. Any file that matches `test.*.js` will be run as a test by the appropriate test runner, based on the folder location.\n\nWe use `gulp` behind the scenes to run the test; if you don't have it installed globally you can use `npm gulp` from inside the project's root folder to run `gulp`.\n\n### Code quality and style\n\nBecause we have multiple contributors working on our projects, we value consistent code styles. It makes it easier to read code written by many people! :-)\n\nOur tests include unit tests as well as code quality (\"linting\") tests that make sure our test pass a style guide and [JSHint](http://jshint.com/). Instead of submitting code with the wrong indentation or a different style, run the tests and you will be told where your code quality/style differs from ours and instructions on how to fix it.\n\n## History\n\nThis is based on initial work on [fx-ports](https://github.com/nicola/fx-ports) by Nicola Greco.\n\nThe command line utility binary has been removed for this initial iteration, since pretty much all the existing applications using this module were just using the JS code directly, not the binary.\n\n## License\n\nThis program is free software; it is distributed under an\n[Apache License](https://github.com/mozilla/node-firefox-find-ports/blob/master/LICENSE).\n\n## Copyright\n\nCopyright (c) 2014 [Mozilla](https://mozilla.org)\n([Contributors](https://github.com/mozilla/node-firefox-find-ports/graphs/contributors)).\n",
"readmeFilename": "README.md",
"gitHead": "d722736b95f88b6ecb053b0b89fbbc9eaebab732",
"_id": "node-firefox-find-ports@1.2.0",
"_shasum": "43625cee865e6be9de07fc276c1580c7e70368ab",
"_from": "node-firefox-find-ports@^1.2.0"
}