JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 17
  • Score
    100M100P100Q50768F

An optimised Jsonpath parser

Package Exports

  • fastpath

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fastpath) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

fastPath Build Status

An attempt at an optimized jsonpath parser

Check the spec here: http://goessner.net/articles/JsonPath/

Use

var fastpath = require('fastpath');

var matcher = fastpath(pattern);

// or

var matcher = fastpath({
    name: pattern,
    name2: pattern2
});

matcher.evaluate(object);
Pattern Description
$ the root object/element
@ the current object/element
. or [] child operator
.. recursive descent
* wildcard - All objects/elements regardless of their names
[] Native array operator
[,] Names or array indices
[start : end : step] Slices subset of the array based on the start, end and step values
?() applies a filter

The tape tests have most of the patterns supported by the spec.