0.0.14 • Published 6 years ago

mongo-iots-wrapper v0.0.14

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

Mongo io-ts wrapper

Build Status code style: prettier Known Vulnerabilities

Strongly typed mongod db with runtime validation and typescript intellisense.

Usage

Define your interfaces with io-ts

import * as t from 'io-ts';

const User = t.interface({
    dateCreated: t.number;
    name: t.string;
    email: t.string;
});

Use mongo wrapper to define users collection

const mongoClient = mongoWrapper({
    Collections: {
        users: User
    }
});

Get intellisense

intellisense-preview

Get runtime validation

Invalid value "NotANumber" supplied to : { email: string , dateCreated: number, password: string }/dateCreated: number

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.3

6 years ago

0.0.2

7 years ago

0.0.1

7 years ago