jsonata

WebJar for jsonata

License

License

MIT
Categories

Categories

JavaScript Languages Github Development Tools Version Controls JSON Data
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

github-com-jsonata-js-jsonata
Last Version

Last Version

1.5.0
Release Date

Release Date

Type

Type

jar
Description

Description

jsonata
WebJar for jsonata
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/jsonata-js/jsonata

Download github-com-jsonata-js-jsonata

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-jsonata-js-jsonata/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-jsonata-js-jsonata</artifactId>
    <version>1.5.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-jsonata-js-jsonata/
implementation 'org.webjars.npm:github-com-jsonata-js-jsonata:1.5.0'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-jsonata-js-jsonata/
implementation ("org.webjars.npm:github-com-jsonata-js-jsonata:1.5.0")
'org.webjars.npm:github-com-jsonata-js-jsonata:jar:1.5.0'
<dependency org="org.webjars.npm" name="github-com-jsonata-js-jsonata" rev="1.5.0">
  <artifact name="github-com-jsonata-js-jsonata" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-jsonata-js-jsonata', version='1.5.0')
)
libraryDependencies += "org.webjars.npm" % "github-com-jsonata-js-jsonata" % "1.5.0"
[org.webjars.npm/github-com-jsonata-js-jsonata "1.5.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

JSONata

JSON query and transformation language

NPM statistics

Build Status Coverage Status

Reference implementation of the JSONata query and transformation language.

Installation

  • npm install jsonata

Quick start

In Node.js:

var jsonata = require("jsonata");

var data = {
  example: [
    {value: 4},
    {value: 7},
    {value: 13}
  ]
};
var expression = jsonata("$sum(example.value)");
var result = expression.evaluate(data);  // returns 24

In a browser:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>JSONata test</title>
    <script src="https://cdn.jsdelivr.net/npm/jsonata/jsonata.min.js"></script>
    <script>
      function greeting() {
        var json = JSON.parse(document.getElementById('json').value);
        var result = jsonata('"Hello, " & name').evaluate(json);
        document.getElementById('greeting').innerHTML = result;
      }
    </script>
  </head>
  <body>
    <textarea id="json">{ "name": "Wilbur" }</textarea>
    <button onclick="greeting()">Click me</button>
    <p id="greeting"></p>
  </body>
</html>

More information

Contributing

See the CONTRIBUTING.md for details of how to contribute to this repo.

org.webjars.npm

Versions

Version
1.5.0