Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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"
}
}
}
```