bfs
v1.0.0
Published
Find the path of a value in a complex JavaScript object graph/tree
Downloads
23
Maintainers
Readme
bfs
Find the path of a value in a complex JavaScript object graph/tree.
This module is BFS (Breadth-first Search) as a debugging tool to help with quickly understanding the relationships within an object tree/graph.
If you like this project, please star it & follow me to see what other cool projects I'm working on! ❤️
🚦 Quick Setup
In a local project
npm i --no-save bfs
import BFS from 'bfs';
// Search the global scope for all properties that have the MAX_SAFE_INTEGER value
BFS(global, Number.MAX_SAFE_INTEGER);
In browser dev-tools
const { default: BFS } = await import('//unpkg.com/bfs/dist/bfs.esm.js');
// Search the global scope for all properties that have the MAX_SAFE_INTEGER value
BFS(global, Math.max);
In non ESM environments
(function (cb) {
var s = document.createElement('script')
s.src = '//unpkg.com/bfs'
s.onload = cb
document.head.appendChild(s)
})(function () {
// Search the global scope for all properties that have the MAX_SAFE_INTEGER value
BFS(global, Number.MAX_SAFE_INTEGER);
})
⚙️ Options
- timeout (
10000
) - maxFinds (
100
) - silenceErrors (
true
)