npm.io
0.1.4 • Published 1 year ago

json2gbnf

Licence
MIT
Version
0.1.4
Deps
0
Size
245 kB
Vulns
0
Weekly
0
Stars
4

JSON2GBNF

Latest json2gbnf NPM Version License for json2gbnf Downloads per week on NPM for json2gbnf Status of tests for json2gbnf repository Code Coverage for json2gbnf DeepSource issues for json2gbnf

A library for parsing JSON schema definitions into .gbnf grammar files in Javascript.

Install

npm install json2gbnf

Usage

import JSON2GBNF from 'json2gbnf';

const grammar = JSON2GBNF({
  type: 'object',
  properties: {
    number: { type: 'number' },
    street_name: { type: 'string' },
    street_type: { enum: ['Street', 'Avenue', 'Boulevard'] },

  },
});

console.log(grammar); // GBNF grammar

Keywords