在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:jsonata-js/jsonata开源软件地址:https://github.com/jsonata-js/jsonata开源编程语言:JavaScript 99.6%开源软件介绍:JSONataJSON query and transformation language Reference implementation of the JSONata query and transformation language. Installation
Quick startIn 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
ContributingSee the CONTRIBUTING.md for details of how to contribute to this repo. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论