f5io / jsonpath Goto Github PK
View Code? Open in Web Editor NEWPerformant JSONPath implementation that focuses on results
License: MIT License
Performant JSONPath implementation that focuses on results
License: MIT License
would love to try this out, but I am not sure if the api is the same as the https://github.com/dchester/jsonpath or not, does it have apply()?
This looks the most promising of all the JSON path implementations I've seen.
Thanks for creating/maintaining it. I especially love the FP stuff you are using inside.
I'm a Typescript user and would love to use this library with a few of my open source projects.
Could you generate the types and submit it to:
https://github.com/DefinitelyTyped/DefinitelyTyped
Hi,
Your project may be in very early stage. But I thought to add to comparison of various jsonpath js libraries. But I seen that it gave wrong output in case of first query.
I just wanted to to inform you.
var jp = require('@f5io/jsonpath');
var obj = {
'a': {
1: 'la',
2: 'boo',
'h': [
{foo: [1,2,3]},
{foo: [4,5,6]},
{foo: 12, name: 'a'},
{foo: 13.5, name: { 'h': 45}},
{foo: 11.8, name: 'c'},
true,
123,
[3,4,5]
]
},
'b': {
1: 'la',
2: 'boo',
'h': [
{foo: [1,2,3]},
{foo: [4,5,6]},
{foo: 12, name: 'a'},
{foo: 13.5, name: { 'h': 45}},
{foo: 11.8, name: 'c'},
true,
123,
[3,4,5]
]
},
'c': {
1: 'la',
2: 'boo',
'h': [
{foo: [1,2,3]},
{foo: [4,5,6]},
{foo: 12, name: 'a'},
{foo: 13.5, name: { 'h': 45}},
{foo: 11.8, name: 'c'},
true,
123,
[3,4,5]
]
},
'd': {
1: 'la',
2: 'boo',
'h': [
{foo: [1,2,3]},
{foo: [4,5,6]},
{foo: 12, name: 'a'},
{foo: 13.5, name: { 'h': 45}},
{foo: 11.8, name: 'c'},
true,
123,
[3,4,5]
]
}
}
var patterns = {
pattern1: '$..h[*].foo',
pattern2: '$.b[1,2]',
pattern3: '$.b.2',
pattern4: '$..h[?(@.foo>13)]'
}
console.log(jp(patterns.pattern1,obj)); //Incorrect
console.log(jp(patterns.pattern2,obj)); //correct
console.log(jp(patterns.pattern3,obj)); //correct
console.log(jp(patterns.pattern4,obj)); //correct
I tried to run the tests and benchmarks:
Cannot find module '/Users/Research/jsonpath_test/node_modules/@f5io/jsonpath/test/harness'
Can someone confirm?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.