Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aztack/json-ref
JSON with reference
https://github.com/aztack/json-ref
anchor json reference yaml
Last synced: 1 day ago
JSON representation
JSON with reference
- Host: GitHub
- URL: https://github.com/aztack/json-ref
- Owner: aztack
- License: mit
- Created: 2019-11-05T03:43:12.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T00:17:07.000Z (almost 2 years ago)
- Last Synced: 2024-09-26T19:05:58.265Z (about 2 months ago)
- Topics: anchor, json, reference, yaml
- Language: TypeScript
- Size: 635 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# json-ref
JSON with Reference## Example
```js
const deref = require('json-ref').deref;
const config = {
"base": "https://domain.com/dir",
"config": "{$.base}/project.json",
"images": {
"img1": "{$.base}/img1.png",
"img2": "{$.base}/img2.png"
},
"props": {
"button/background": {
"url": "{$.images.img1}"
}
}
};
console.log(deref(config));
```will output
```json
{
"base": "https://domain.com/dir",
"config": "https://domain.com/dir/project.json",
"images": {
"img1": "https://domain.com/dir/img1.png",
"img2": "https://domain.com/dir/img2.png"
},
"props": {
"button/background": {
"url": "https://domain.com/dir/img1.png"
}
}
}
```