json2gbnf
v0.1.3
Published
A library for turning JSON schemas into GBNF grammars
Downloads
7
Readme
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