@adobe/json-formula

1.1.1 • Public • Published

json-formula: A Query Language for JSON with Spreadsheet Functions

This project hosts an implementation of an expression grammar that operates on JSON documents. The grammar is a mashup of:

Given:

{
  "items": [
    {
      "desc": "pens",
      "quantity": 2,
      "price": 3.23
    },
    {
      "desc": "pencils",
      "quantity": 4,
      "price": 1.34
    }
  ]
}

sum(items[*].price * items[*].quantity) => 11.82

items[*].{price: price, quantity: quantity, subtotal: price * quantity} =>

[
  {
    "price": 3.23,
    "quantity": 2,
    "subtotal": 6.46
  },
  {
    "price": 1.34,
    "quantity": 4,
    "subtotal": 5.36
  }
]

Try it

Visit the Playground

Documentation

Specification / Reference: HTML / PDF

JavaScript API

Developer Instructions

Readme

Keywords

none

Package Sidebar

Install

npm i @adobe/json-formula

Weekly Downloads

574

Version

1.1.1

License

Apache-2.0

Unpacked Size

187 kB

Total Files

18

Last publish

Collaborators

  • dylandepass
  • djaeggi
  • adobehalls
  • fullcolorcoder
  • marbec
  • tripod
  • garthdb
  • lazd
  • adobe-admin
  • patrickfulton
  • trieloff
  • shazron
  • krisnye
  • dcpfsdk
  • natebaldwin
  • devongovett
  • aspro83
  • symanovi
  • dpfister
  • stefan-guggisberg
  • korra
  • rofe
  • kptdobe