https://github.com/taskcluster/json-parameterization
Node.js Module for Parameterization of JSON Structures
https://github.com/taskcluster/json-parameterization
Last synced: 2 months ago
JSON representation
Node.js Module for Parameterization of JSON Structures
- Host: GitHub
- URL: https://github.com/taskcluster/json-parameterization
- Owner: taskcluster
- License: mit
- Created: 2019-07-16T16:49:52.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-05-10T17:04:42.000Z (about 5 years ago)
- Last Synced: 2026-03-27T03:27:31.742Z (2 months ago)
- Language: JavaScript
- Size: 52.7 KB
- Stars: 0
- Watchers: 1
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
json-parameterization - Parameterization of JSON Structures
===========================================================
Parameterize untrusted JSON structures safely. This is basically a very simple
library for substituting strings into JSON structures.
**Example**
```js
var parameterize = require('json-parameterization');
var input = {
"{{key-prefix}}Key": "{{now}} ms",
"say": "{{Hello World | to-lower }}"
};
var params = {
'key-prefix': 'time',
'now': function() {
return new Date().getTime();
},
'to-lower': function(param) {
return param.toLowerCase();
}
};
parameterize(input, params);
```
**Result**
```js
{
timeKey: "1411165317832 ms",
say: "hello world"
}
```
License
-------
The `json-parameterization` library is released on the MIT license, see the
`LICENSE` for complete license.