0.0.14 • Published 7 years ago

mongo-iots-wrapper v0.0.14

Weekly downloads
-
License
MIT
Repository
-
Last release
7 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

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago