0.0.3 • Published 4 years ago

sapiddu v0.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

sapiddu - JsonStore.io wrapper

a small wrapper to use jsonstore.io as db

Install

npm i sapiddu

You will need to have a .env file on the root of your project with:

TOKEN=THE_JSON_STORE_IO_TOKEN

to get the jsonstore.io token head to their website.

const sapiddu = require('sapiddu');

const em = sapiddu.entityManager();
const people = em.getEntity('people', sapiddu.EntityTypes.TIMESTAMPS);

people.create({
    name:'Mario', 
    surname: 'Rossi'
}).then(result => console.log(result));
// output → { id: '01D1NQBVYS9JNZ699J0M6V1CMG' }

// At some other point
people.get().then(result => console.log(result));
/* output →
{
    '01D1NQBVYS9JNZ699J0M6V1CMG': {
        name: 'Mario',
        surname: 'Rossi',
        created: 1547991118,
        updated: 1547991118,
     }
}
*/
0.0.3

4 years ago

0.0.2

5 years ago

0.0.1

5 years ago