JSON to SQL: build RESTful API servers on the fly by accepting JSON describing SQL query statements. Version 2.0.13 supports CRUD operations, joins, aggregations, where conditions with operators (gt, lt, in, between, etc.), relation manipulation, and configurable access control. It relies on Bookshelf.js (and Knex.js) for ORM and query building, and is tested with Koa.js. Unlike traditional REST frameworks, j2s shifts query complexity to the client, reducing backend code for data fetching.
npm install j2sNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Minimal setup: create Koa app, configure knex/bookshelf, define a model, instantiate J2s, attach controller router.
Change 'app.use(new J2s({...}))' to 'app.use(new J2s({...}).controller())'Use 'const J2s = require('j2s').default'Install 'npm install bookshelf knex'
Use Koa.js or wrap j2s controller for other frameworks
const J2s = require('j2s').defaultapp.use(new J2s(options).controller())
npm install bookshelf
npm install knex