1.0.2 • Published 1 year ago

@razorlabs/razor-db v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

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
1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago