{"versions":{"0.0.0-dev":{"name":"cordova-plugin-node","version":"0.0.0-dev","description":"Cordova Plugin for the Node+ Platform developed by Variable, Inc.","repository":{"type":"git","url":"https://github.com/cjschooley/cordova-plugin-node.git"},"keywords":["cordova","node","variable"],"author":{"name":"Cory Schooley"},"license":"Apache 2.0","bugs":{"url":"https://github.com/cjschooley/cordova-plugin-node/issues"},"homepage":"https://github.com/cjschooley/cordova-plugin-node","gitHead":"3aaf73da08f822ad6b9665895d1a9275917e44f1","_id":"cordova-plugin-node@0.0.0-dev","scripts":{},"_shasum":"e408584801c243803f7897f166b2ea4f92729caa","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.2","_npmUser":{"name":"anonymous","email":"cjschooley@gmail.com"},"dist":{"shasum":"e408584801c243803f7897f166b2ea4f92729caa","tarball":"http://123.232.10.234:8212/nexus/content/repositories/npm-private/cordova-plugin-node/-/cordova-plugin-node-0.0.0-dev.tgz","size":4861953,"integrity":"sha512-xI3zJ520SnJdZEAJMIzGiW/y74URNX+ch5tiHbikFYGJEAubIT12EhHYQ3KwhEvVqMzaNmwd8TKaQmBxv1enIg=="},"maintainers":[{"name":"anonymous","email":"cjschooley@gmail.com"}],"directories":{},"_cnpmcore_publish_time":"2021-12-23T08:31:14.739Z","contributors":[]},"0.1.0":{"name":"cordova-plugin-node","version":"0.1.0","description":"Cordova Plugin for the Node+ Platform developed by Variable, Inc.","cordova":{"id":"cordova-plugin-node","platforms":["android","ios"]},"repository":{"type":"git","url":"https://github.com/cjschooley/cordova-plugin-node.git"},"keywords":["cordova","node","variable"],"author":{"name":"Cory Schooley"},"license":"Apache 2.0","bugs":{"url":"https://github.com/cjschooley/cordova-plugin-node/issues"},"homepage":"https://github.com/cjschooley/cordova-plugin-node","gitHead":"89c9c1dc95e164a8b8d0ba647158472f534fef53","_id":"cordova-plugin-node@0.1.0","scripts":{},"_shasum":"6d5a84ca2e2c21a023565d187762332220ba4391","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.2","_npmUser":{"name":"anonymous","email":"cjschooley@gmail.com"},"dist":{"shasum":"6d5a84ca2e2c21a023565d187762332220ba4391","tarball":"http://123.232.10.234:8212/nexus/content/repositories/npm-private/cordova-plugin-node/-/cordova-plugin-node-0.1.0.tgz","size":4862745,"integrity":"sha512-zm41Xj6/MTD5MR6mdWJHI1hJjBqFHzei56S9A3EtHAF3Xl3O3JJ6uqoQFiESO4Egz6agqGDETHtLCcwcKoyjKg=="},"maintainers":[{"name":"anonymous","email":"cjschooley@gmail.com"}],"directories":{},"_cnpmcore_publish_time":"2021-12-23T08:31:20.564Z","contributors":[]},"0.1.1":{"name":"cordova-plugin-node","version":"0.1.1","description":"Cordova Plugin for the Node+ Platform developed by Variable, Inc.","cordova":{"id":"cordova-plugin-node","platforms":["android","ios"]},"repository":{"type":"git","url":"https://github.com/cjschooley/cordova-plugin-node.git"},"keywords":["cordova","node","variable"],"author":{"name":"Cory Schooley"},"license":"Apache 2.0","bugs":{"url":"https://github.com/cjschooley/cordova-plugin-node/issues"},"homepage":"https://github.com/cjschooley/cordova-plugin-node","gitHead":"6ecffca682c9dfd18a3a05ebc3841113a528f15f","_id":"cordova-plugin-node@0.1.1","scripts":{},"_shasum":"ef644affc8d1c80078ec860b45fa8f3e1eb89c0e","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.2","_npmUser":{"name":"anonymous","email":"cjschooley@gmail.com"},"dist":{"shasum":"ef644affc8d1c80078ec860b45fa8f3e1eb89c0e","tarball":"http://123.232.10.234:8212/nexus/content/repositories/npm-private/cordova-plugin-node/-/cordova-plugin-node-0.1.1.tgz","size":4863103,"integrity":"sha512-J6GSDD1xwPUOLVQhen3KvOvRlgPWqE57fuZA46LIXc83uK5rGW3Hge7hj4S6vhoFLfA/11slippcxZo9Gga71A=="},"maintainers":[{"name":"anonymous","email":"cjschooley@gmail.com"}],"directories":{},"_cnpmcore_publish_time":"2021-12-23T08:31:29.008Z","contributors":[]}},"dist-tags":{"latest":"0.1.1"},"name":"cordova-plugin-node","time":{"created":"2022-01-27T01:24:47.027Z","modified":"2022-01-27T01:24:47.027Z","0.0.0-dev":"2015-09-11T13:25:12.724Z","0.1.0":"2015-09-16T18:49:59.579Z","0.1.1":"2015-09-28T14:58:26.028Z"},"readme":"# cordova-plugin-node\nThis plugin provides access to some native functionality using the [Node+ Platform](http://www.variableinc.com/#!node1/c1g5n) developed by [Variable, Inc.](http://www.variableinc.com/) via a global `node` object.\n\nThis plugin is being built apart from a separate AngularJS Module that I am also developing that will use this Cordova Plugin; it may be found at [cjschooley/ng-node](https://github.com/cjschooley/ng-node) (NYI).\n\n## Contributing\nI know that I cannot be the only developer out there who wants to use Variable's Node+ Platform using Cordova; if you would like to contribute, open issues or offer suggestions, that'd be awesomesauce. :)\n\nAs I am developing this for my employer, there are a couple modules taking the forefront (Therma and Thermocouple), but I do intend on building this beyond those two; again, contributions welcome.\n\n## Supported Platforms\n* Android\n* iOS\n\n## Installation\n```\ncordova plugin add https://github.com/cjschooley/cordova-plugin-node.git\n```\n\nYou may also install the plugin via the NPM Registry, but it is not recommended at this time; NPM strips out all Symbolic Links upon publishing thus screwing with the iOS Framework copied within this repository. Please see Cordova Issue [CB-6092](https://issues.apache.org/jira/browse/CB-6092); linked therein, also, NPM Issue [3310](https://github.com/npm/npm/issues/3310).\n```\ncordova plugin add cordova-plugin-node\n```\n\nI will continue to maintain the package there as well regardless.\n\n## Methods\n* `node.connect`\n* `node.disconnect`\n* `node.requestBatteryLevel`\n* `node.setStreamMode`\n* `node.setStreamModeThermocouple`\n\n### node.connect\nConnect to a Node+ Device.\n\n```javascript\nnode.connect(options, success, failure);\n```\n\n#### Example\n```javascript\nnode.connect(\n  {\n    address: 'AA:BB:CC:11:22:33', // Required; MAC Address or UUID for Android and iOS respectively\n    batteryListener: true,        // Optional; listen for low/critical battery (see Events); defaults true\n    buttonListener: true,         // Optional; listen for button to be pushed and released (see Events); defaults true\n    disconnectListener: true      // Optional; listen for the node to disconnect (see Events); defaults true\n  },\n  function(result) {alert('We connected to your Node!')},\n  function(error) {alert('Unfortunately, we were unable to connect to your Node.')}\n)\n```\n\n### node.disconnect\nDisconnect from currently-connected Node+ Device.\n\n```javascript\nnode.disconnect(success, failure);\n```\n\n#### Example\n```javascript\nnode.disconnect(\n  function(result) {alert('We disconnected from your Node!')},\n  function(error) {alert('Really!? An error occurred as we were attempting to disconnect your Node? How absurd.')}\n)\n```\n\n### node.requestBatteryLevel\nRequest that the Node update its Battery Level and return the percentage to your `success` callback.\n\n```javascript\nnode.requestBatteryLevel(success, failure);\n```\n\n#### Success Result\n```json\n{\n  \"percent\": 75,\n  \"volts\": 4.075123\n}\n```\n\n#### Example\n```javascript\nnode.requestBatteryLevel(\n  function(result) {alert('Your Node is currently at '+result.percent+'%.')}, // Alerts \"Your Node is currently at 75%.\" with above result.\n  function(error) {alert('Hmmm...')}\n)\n```\n\n### node.setStreamMode\nAllows the developer to set the stream mode of the Therma (Infrared) Module. In addition to the standard `options`, `success` and `failure` parameters, we may provide a `stream` callback. When enabling, the `success` callback simply signifies that you were successful in enabling the Therma Module; when disabling, the `success` callback will contain the last result that the `stream` callback passed (or would've passed if you chose to not provide a `stream` callback).\n\n```javascript\nnode.setStreamMode(options, success, failure, stream);\n```\n\n#### Success and Stream Result\n```json\n{\n  \"event\": \"onTemperatureReading\",\n  \"sensor\": \"therma\",\n  \"celsius\": 23.969995,\n  \"fahrenheit\": 75.14599609375\n}\n```\n\n#### Example\n```javascript\n// Enabling the Therma Module\nnode.setStreamMode(\n  {\n    irMode: true,   // Optional; Enable or Disable the Therma Module with `true` or `false` respectively; defaults `false`\n    ledMode: true   // Optional; Enable or Disable the LED Leads on the Therma Module with `true` or `false` respectively; defaults `false`\n  },\n  function(result) {alert('Your Therma Module has been enabled.')},         // `result` will be `undefined`.\n  function(error) {alert('We were unable to enable the Therma Module.')},\n  function(stream) {console.log(stream.fahrenheit)}                         // Will log the `75.14599609375` with above result; please note: this will trigger rapidly.\n);\n\n// Disabling the Therma Module\nnode.setStreamMode(\n  {},               // Required; the keys are optional, not the parameter\n  function(result) {alert('The surface temperature of the portrait on the wall is '+Math.round(result.fahrenheit)+'°F.')},  // Alerts \"The surface temperature of the portrait on the wall is 75°F.\" with above result.\n  function(error) {alert('Well, we apparently failed at turning off this sensor...')}\n  // Notice the complete lack of a `stream` callback; completely optional - even when we enable the sensor.\n)\n```\n\n### node.setStreamModeThermocouple\nAllows the developer to set the stream mode of the Thermocouple (Probe) Module. In addition to the standard `options`, `success` and `failure` parameters, we may provide a `stream` callback. When enabling, the `success` callback simply signifies that you were successful in enabling the Thermocouple Module; when disabling, the `success` callback will contain the last result that the `stream` callback passed (or would've passed if you chose to not provide a `stream` callback).\n\n```javascript\nnode.setStreamModeThermocouple(options, success, failure, stream);\n```\n\n#### Success and Stream Result\n```json\n{\n  \"event\": \"onThermoCoupleReading\",\n  \"sensor\": \"thermocouple\",\n  \"celsius\": 23.969995,\n  \"fahrenheit\": 75.14599609375\n}\n```\n\n#### Example\n```javascript\n// Enabling the Thermocouple Module\nnode.setStreamModeThermocouple(\n  {\n    enabled: true,  // Optional; Enable or Disable the Thermocouple Module with `true` or `false` respectively; defaults `false`\n    period: 10,     // Optional; The period between readings in units of 10ms (period * 10ms); defaults 0\n    lifetime: 0     // Optional; The number of readings to collect; defaults 0 (infinite)\n  },\n  function(result) {alert('Your Thermocouple Module has been enabled.')},       // `result` will be `undefined`.\n  function(error) {alert('We were unable to enable the Thermocouple Module.')},\n  function(stream) {console.log(stream.fahrenheit)}                             // Will log the `75.14599609375` with above result; please note: this will trigger rapidly.\n);\n\n// Disabling the Thermocouple Module\nnode.setStreamModeThermocouple(\n  {},               // Required; the keys are optional, not the parameter\n  function(result) {alert('The core liver temperature is '+Math.round(result.fahrenheit)+'°F.')},  // Alerts \"The score liver temperature is 75°F.\" with above result.\n  function(error) {alert('Well, we apparently failed at turning off this sensor; keep probing that liver!')}\n  // Notice the complete lack of a `stream` callback; completely optional - even when we enable the sensor.\n)\n```\n\n## Events\n* `node-battery-status`\n* `node-battery-low`\n* `node-battery-critical`\n* `node-button-pushed`\n* `node-button-released`\n* `node-disconnected`\n\n### node-battery-status\nEvent dispatched when the connected Node+ Device's Battery Level changes from the current level.\n\n#### Example\n```javascript\nwindow.addEventListener(\"node-battery-status\", function(battery) {\n  alert(\"Battery at \"+battery.percent+\"% capacity.\");\n});\n```\n\n### node-battery-low\nEvent dispatched when the connected Node+ Device's Battery Level dips below 30%. (This will be made configurable at some point.)\n\n#### Example\n```javascript\nwindow.addEventListener(\"node-battery-low\", function(battery) {\n  alert(\"I dare say good sir or madam; it would seem that your Node's battery strength is weakening; presently it rests at \"+battery.percent+\"%.\");\n});\n```\n\n### node-battery-critical\nEvent dispatched when the connected Node+ Device's Battery Level dips below 10%. (This will be made configurable at some point.)\n\n#### Example\n```javascript\nwindow.addEventListener(\"node-battery-critical\", function(battery) {\n  alert(\"Hehe, you Node is at \"+battery.percent+\"%; you better get your Node plugged into something right away...\");\n});\n```\n\n### node-button-pushed\nEvent dispatched when the connected Node+ Device's Button is pushed. Currently, no additional data is passed along with the event.\n\n#### Example\n```javascript\nwindow.addEventListener(\"node-button-pushed\", function() {\n  alert(\"You make me pulse my lights when you push my button! Love, Node\");\n});\n```\n\n### node-button-released\nEvent dispatched when the connected Node+ Device's Button is released. Currently, no additional data is passed along with the event.\n\n#### Example\n```javascript\nwindow.addEventListener(\"node-button-released\", function() {\n  alert(\"You got bored? Why'd you release my button?\");\n});\n```\n\n### node-disconnected\nEvent dispatched when the connected Node+ Device disconnects. Currently, no additional data is passed along with the event.\n\n#### Example\n```javascript\nwindow.addEventListener(\"node-disconnected\", function() {\n  alert(\"Sorry, but we lost your Node.\");\n});\n```","users":{}}