A TypeScript implementation of jq
query language for JSON
npm install jqts
For TypeScript:
import jq from 'jqts';
const pattern = jq.compile('[.[].x]');
pattern.evaluate([{ x: 1, x: 2 }]); // [1, 2]
For JavaScript:
const jq = require('jqts').default;
const pattern = jq.compile('[.[].x]');
pattern.evaluate([{ x: 1, x: 2 }]); // [1, 2]
MIT