pax_global_header00006660000000000000000000000064136415743550014527gustar00rootroot0000000000000052 comment=7f7978d4f1f13df72e5f429d58e5f983dda6c063 dom-walk-0.1.2/000077500000000000000000000000001364157435500132425ustar00rootroot00000000000000dom-walk-0.1.2/.gitignore000066400000000000000000000000531364157435500152300ustar00rootroot00000000000000package-lock.json node_modules *.log *.err dom-walk-0.1.2/LICENCE000066400000000000000000000020321364157435500142240ustar00rootroot00000000000000Copyright (c) 2012 Raynos. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.dom-walk-0.1.2/Makefile000066400000000000000000000000711364157435500147000ustar00rootroot00000000000000run: ./node_modules/.bin/browserify-server --cwd exampledom-walk-0.1.2/README.md000066400000000000000000000004071364157435500145220ustar00rootroot00000000000000# dom-walk iteratively walk a DOM node ## Example ``` js var walk = require("dom-walk") walk(document.body.childNodes, function (node) { console.log("node", node) }) ``` ## Installation `npm install dom-walk` ## Contributors - Raynos ## MIT Licenceddom-walk-0.1.2/example/000077500000000000000000000000001364157435500146755ustar00rootroot00000000000000dom-walk-0.1.2/example/index.js000066400000000000000000000001421364157435500163370ustar00rootroot00000000000000var walk = require("../index") walk(document, function (node) { console.log("node", node) }) dom-walk-0.1.2/index.js000066400000000000000000000007431364157435500147130ustar00rootroot00000000000000var slice = Array.prototype.slice module.exports = iterativelyWalk function iterativelyWalk(nodes, cb) { if (!('length' in nodes)) { nodes = [nodes] } nodes = slice.call(nodes) while(nodes.length) { var node = nodes.shift(), ret = cb(node) if (ret) { return ret } if (node.childNodes && node.childNodes.length) { nodes = slice.call(node.childNodes).concat(nodes) } } } dom-walk-0.1.2/package.json000066400000000000000000000013031364157435500155250ustar00rootroot00000000000000{ "name": "dom-walk", "version": "0.1.2", "description": "iteratively walk a DOM node", "keywords": [], "author": "Raynos ", "repository": "git://github.com/Raynos/dom-walk.git", "main": "index", "homepage": "https://github.com/Raynos/dom-walk", "contributors": [ { "name": "Jake Verbaten" } ], "bugs": { "url": "https://github.com/Raynos/dom-walk/issues", "email": "raynos2@gmail.com" }, "dependencies": {}, "devDependencies": { "budo": "11.6.3" }, "licenses": [ { "type": "MIT", "url": "http://github.com/Raynos/dom-walk/raw/master/LICENSE" } ], "scripts": { "example": "budo example/index.js" } }