Skip to content

object-scanvskiba

MIT 16 8 182
134.2 thousand (month) Jun 10 2018 20.0.4(2025-12-10 19:58:29 ago)
1,773 1 - LGPL-3.0
Apr 18 2015 33.5 thousand (month) 4.0.0(2021-03-24 12:37:03 ago)

object-scan allows traversal of complex javascript objects to find specific keys.

In web scraping, it's useful for parsing large, nested JSON datasets for specific datafields. object-scan can be used to recursively find any key in any object structure: ```javascript import objectScan from 'object-scan';

const haystack = { a: { b: { c: 'd' }, e: { f: 'g' } } }; objectScan(['a.*.f'], { joined: true })(haystack); // => [ 'a.e.f' ] ```

Kiba is a lightweight Ruby gem that provides a simple and powerful way to process and transform data in an ETL (Extract, Transform, Load) pipeline. It allows you to define a set of operations to perform on the data, and then automatically applies those operations to the data, making it easy to extract, transform, and load data from various sources and formats.

Kiba provides a simple and intuitive API for defining the pipeline, and it is built on top of the Enumerator API, which allows for easy manipulation of large datasets with low memory usage.

Example Use


```javascript const objectScan = require('object-scan'); const myNestedObject = { level1: { level2: { level3: { myTargetKey: 'value', }, }, }, }; const searchTerm = 'myTargetKey'; const result = objectScan([`**.${searchTerm}`], { joined: false })(myNestedObject); console.log(result); ```
```ruby require 'kiba' data = [{ name: 'Alice', age: 25 }, { name: 'Bob', age: 30 }] Kiba.parse do source Kiba::Common::EnumerableSource, data transform { |row| row[:age] += 1 } destination Kiba::Common::EnumerableDestination end.run # Output: [{ name: 'Alice', age: 26 }, { name: 'Bob', age: 31 }] ```

Alternatives / Similar


Was this page helpful?