@razorlabs/razor-db
v1.0.2
Published
A JSON Based Database
Downloads
7
Readme
Razor DB
A JSON database with Models, Schemas, and a flexible querying interface. It powers all Razor Labs APIs in dev mode.
Installation
$ pnpm add @razorlabs/razor-db
Usage
const Database = require('@razorlabs/razor-db');
const db = new Database();
const Post = db.model('posts', {
title: String,
created: {type: Date, default: Date.now}
});
Post.insert({
title: 'Hello world'
}).then(function(post){
console.log(post);
});
import { Database } from '@razorlabs/razor-db';
const db = new Database();
const Post = db.model('posts', {
title: String,
created: {type: Date, default: Date.now}
});
Post.insert({
title: 'Hello world'
}).then(function(post){
console.log(post);
});
Test
$ pnpm test