Find the path of a value in a complex JavaScript object graph/tree
npm install bfsFind 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! ❤️
``sh`
npm i --no-save bfs
`js
import BFS from 'bfs';
// Search the global scope for all properties that have the MAX_SAFE_INTEGER value
BFS(global, Number.MAX_SAFE_INTEGER);
`
`js
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);
`
js
(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`)