Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

strangedev/tiny-blog-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tiny-blog-db

JavaScript database connector for tiny-blog.

npm codecov

Uses a MongoDB as storage backend.

Models follow the tiny-blog-api spec: https://github.com/strangedev/tiny-blog-api/tree/master/spec

Related repos

Usage

API Structure

  • BlogEntry
  • store(host, port)
    • getDb
    • BlogEntry
      • view
        • newest
        • byTag
      • mutation
        • insert
        • remove
        • update
    • Tag
      • view
        • all

Example

import {Store} from "tiny-blog-db";
const store = Store("localhost", 27017);

let offset = 0;
let limit = 50;
let cancel = store.BlogEntry.view.newest(offset, limit).fork(
    console.err,
    result => {
        // do something with the result...
        console.log(result);
    }
);

Development

yarn install

# transpile JS to build/
yarn run build

# run tests
yarn run test

About

JavaScript databse connector for tiny-blog.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published