Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/syall/json-synthesizer
Program Synthesizer from JSON data sources that produces Transpilable Typed JSON.
https://github.com/syall/json-synthesizer
data-structure json json-synthesizer program-synthesis version-space-algebra
Last synced: about 4 hours ago
JSON representation
Program Synthesizer from JSON data sources that produces Transpilable Typed JSON.
- Host: GitHub
- URL: https://github.com/syall/json-synthesizer
- Owner: syall
- Created: 2020-11-19T13:47:43.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-10T04:43:19.000Z (almost 4 years ago)
- Last Synced: 2024-11-09T16:07:08.304Z (6 days ago)
- Topics: data-structure, json, json-synthesizer, program-synthesis, version-space-algebra
- Language: JavaScript
- Homepage: https://json-synthesizer.syall.work
- Size: 1.38 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# json-synthesizer
## Overview
Program Synthesizer from JSON data sources that produces Transpilable Typed JSON.
## Usage
Install the module using `npm`:
```shell
npm install json-synthesizer
```To use the synthesizer in [node](https://nodejs.org/):
```javascript
// Import synthesize function
const synthesize = require('json-synthesizer');// Define High Level Specification
const specification = {
inputOutputExamples: [
{
source: 'tag',
input: {
// Input JSON
},
output: {
// Restructured Transformed Input
}
},
// ...
],
transforms: [
{
source: 'tag',
transform: function customTransform(json) {
// Transform JSON
return transformedJson;
}
},
// ...
]
};// Output Synthesized Typed JSON String
console.log(synthesize(specification));
```## Exports
```javascript
// Default Export
module.exports = synthesize;// VSA Exports
module.exports.vsa = {
convertJsonToTypedMap,
convertTypedMapToTypedJson,
intersects: {
intersectTypedMaps,
intersectTypes
},
mapTransformsOnJson,
restructureTypedMaps,
unions: {
unionTypedMaps,
unionTypes
}
};// Util Exports
module.exports.util = {
isType: {
isArray,
isNull,
isObject,
singleValue
},
str
};
```## Documentation
The main webpage for json-synthesizer can be found at [here](https://json-synthesizer.syall.work).
- Design Documentation is available [here](https://json-synthesizer.syall.work/DESIGN).
- JSDoc Documentation is available [here](https://json-synthesizer.syall.work/docs).
- GitHub Repository is available [here](https://github.com/syall/json-synthesizer).
- NPM Package is available [here](https://www.npmjs.com/package/json-synthesizer).