Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json-synthesizer

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-synthesizer

Program Synthesizer from JSON data sources that produces Transpilable Typed JSON.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

json-synthesizer

Overview

Program Synthesizer from JSON data sources that produces Transpilable Typed JSON.

Usage

Install the module using npm:

npm install json-synthesizer

To use the synthesizer in node:

// 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

// 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.

  • Design Documentation is available here.
  • JSDoc Documentation is available here.
  • GitHub Repository is available here.
  • NPM Package is available here.

Keywords

FAQs

Package last updated on 10 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc