├── .gitignore ├── .travis.yml ├── spec ├── host_scan_spec.js ├── host_probe_spec.js └── utils_spec.js ├── package.json ├── src ├── utils.js ├── ip_discovery.js ├── host_scan.js ├── device_scan.js └── db.js ├── Gruntfile.js ├── DOCUMENTATION.md ├── LICENSE ├── demo.html ├── README.md └── examples └── dashboard.html /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | -------------------------------------------------------------------------------- /spec/host_scan_spec.js: -------------------------------------------------------------------------------- 1 | describe("lan.HostScan", function() { 2 | 3 | }); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lan-js", 3 | "version": "0.2.0", 4 | "description": "Probe LAN devices from a web browser.", 5 | "author": "Joe Vennix", 6 | "devDependencies": { 7 | "grunt": "~0.4.1", 8 | "grunt-contrib-jshint": "~0.6.3", 9 | "grunt-contrib-uglify": "~0.2.2", 10 | "grunt-contrib-concat": "~0.3.0", 11 | "grunt-contrib-watch": "~0.5.3", 12 | "grunt-contrib-jasmine": "~0.5.2", 13 | "grunt-contrib-compress": "0.7.0", 14 | "grunt-cli": "~0.1.13" 15 | }, 16 | "scripts": { 17 | "test": "./node_modules/.bin/grunt" 18 | }, 19 | "license": "BSD-3-Clause", 20 | "repository": { 21 | "type": "git", 22 | "url": "https://github.com/jvennix-r7/lan-js" 23 | }, 24 | "bugs": { 25 | "url": "https://github.com/jvennix-r7/lan-js/issues" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/utils.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Small collection of shims and global functions. 3 | */ 4 | (function() { 5 | 6 | // really hard to live without this 7 | var merge = function(_this, hash) { 8 | for (var k in hash) { _this[k] = hash[k]; } 9 | return _this; 10 | }; 11 | 12 | // normalize #forEach() implementation, for my sanity. 13 | var each = function(_this, cb) { 14 | for (var i = 0; i < _this.length; i++) cb(_this[i], i); 15 | }; 16 | 17 | // list some useful constants 18 | var constants = { 19 | // set #style of any DOMElement to this to hide 20 | HIDDEN_STYLE: 'position:fixed;top:-500px;left:-500px;visibility:hidden;' 21 | }; 22 | 23 | /* 24 | * Creates and returns an