{"_id":"8o","_rev":"4-3b38ab0c5849f6e4af77baab0e1bc0cd","name":"8o","description":"Oxide (8O) is a javascript library to get connection information and allows the browser to load certain content only if a minimum speed requirements are met.","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"8o","version":"1.0.0","description":"Oxide (8O) is a javascript library to get connection information and allows the browser to load certain content only if a minimum speed requirements are met.","dependencies":{"concat":"^3.0.0","uglify-js":"^2.8.20","webrtc-adapter":"^3.2.0"},"devDependencies":{},"scripts":{"clean":"rm -r release/*","build:development":"node_modules/concat/bin/concat -o release/oxide.dev.js node_modules/webrtc-adapter/out/adapter.js src/*.js","build:minified":"node_modules/uglify-js/bin/uglifyjs release/oxide.dev.js -o release/oxide.min.js -c -m","build":"npm run build:development && npm run build:minified","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/irbiznl/oxide.git"},"keywords":["responsive","reactive","javascript","webrtc","STUN","ip","ipaddress"],"author":{"name":"Francois de Quillettes","url":"irbiz software development"},"license":"ISC","bugs":{"url":"https://github.com/irbiznl/oxide/issues"},"homepage":"https://github.com/irbiznl/oxide#readme","gitHead":"9178043342717f266b09ce942b0d2137298433a4","_id":"8o@1.0.0","_shasum":"61d5c437cd9b65d9e355cedb1af7a27711d0a54c","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.2","_npmUser":{"name":"fdequillettes","email":"fdequillettes@hotmail.com"},"dist":{"shasum":"61d5c437cd9b65d9e355cedb1af7a27711d0a54c","tarball":"https://registry.npmjs.org/8o/-/8o-1.0.0.tgz","integrity":"sha512-GlwIO2uKh9x6NrYyxIhaa7nlKrUGsDfko8BR8NUNI0fQe3owdX7n5O1eyfpZn0Knsqrfz+ptyxINzxQts2cjLA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHr0116tbpoNPoaSZvvfG/Mv6VEHZm1f253ghpqT4nWdAiAOXtNTCWFQbH9Mvvsfr7f+/7ElWd/ElpjSvtll0tBjjw=="}]},"maintainers":[{"name":"fdequillettes","email":"fdequillettes@hotmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/8o-1.0.0.tgz_1491169425489_0.14564010850153863"}}},"readme":"# <sub>8</sub>O (Oxide)\n> <sub>8</sub>O (Oxide) is a javascript library to get connection information and allows the browser to load certain content only if a minimum speed requirements are met.\n\n## Getting started\n\n### Install\nInstall: `npm install --save-dev 8o`\n\nAfter that you can either:\n- Include/copy one of the files in **release** to your project to start using the full library.\n- Include one or more of the files in **src** if you require only some of the functionality. The most suitable files for standalone use are:\n  - **benchmarker.js** if you only want to use the speedtest components and not store the results across page navigations.\n  - **ipmonitor.js** if you want to check ip address/connection changes while the user stays on the same webpage.\n\nIn all other scenarios you probably want to include the entire built library from the **release** folder.\n\n### Usage\nThe following example determines the average speed over 3 file downloads and when all three are done downloading decides wether or not to show a video.\n``` js\nvar files = [\n    'https://upload.wikimedia.org/wikipedia/commons/1/18/F-35_EOTS.jpeg',\n    'https://upload.wikimedia.org/wikipedia/commons/6/67/Hydra_70_M261.jpeg',\n    'https://upload.wikimedia.org/wikipedia/commons/0/0c/Oasis_Hong_Kong.jpeg'\n];\n\ndocument.addEventListener(\"onOxideSpeedChange\", function(e) {\n    console.log( 'Connection speed: ' + Math.round(e.detail.speed) + ' kB/s, last file speed: '+Math.round(e.detail.lastFileSpeed) + ' kB/s, last file size: '+Math.round((e.detail.lastFileLoadTime*e.detail.lastFileSpeed)/1000) + ' kB');\n    if( e.detail.queueSize == 0 ) {\n        if( e.detail.speed >= 1000 ) {\n            document.write('<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/4SNGyKZ1DjM\" frameborder=\"0\" allowfullscreen></iframe>');\n        }\n        else {\n            alert('We only recommend video if your internet speed is over 1000 kB/s');\n        }\n    }\n});\n\nvar oxide = new Oxide();\nfor(var i = 0; i < files.length; i++ ) {\n    oxide.load(files[i]);\n}\n```\n\n### Build\nThe library comes pre-built if you get it from Github or NPM.\nHowever if you want to customise it or build it yourself the **package.json** config file for npm includes build commands.\n\nUse `npm run build` to build the releases from your source or `npm run` to see an overview of all other commands.\n\n## License\nISC License\n\nCopyright (c) 2017, irbiz.nl and other contributors\n\nPermission to use, copy, modify, or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE\nOR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.","maintainers":[{"name":"fdequillettes","email":"fdequillettes@hotmail.com"}],"time":{"modified":"2022-06-12T14:08:51.335Z","created":"2017-04-02T21:43:46.167Z","1.0.0":"2017-04-02T21:43:46.167Z"},"homepage":"https://github.com/irbiznl/oxide#readme","keywords":["responsive","reactive","javascript","webrtc","STUN","ip","ipaddress"],"repository":{"type":"git","url":"git+https://github.com/irbiznl/oxide.git"},"author":{"name":"Francois de Quillettes","url":"irbiz software development"},"bugs":{"url":"https://github.com/irbiznl/oxide/issues"},"license":"ISC","readmeFilename":"README.md","users":{"fdequillettes":true}}