1.0.21 • Published 3 years ago

dynogels-promise v1.0.21

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

dynogels-promise

This package was created for two main reasons:

  1. the maintainer of dynogels has not fixed a vulnerability that exists in the package eventhough a PR has been submitted for fixing that close to year now. See here

  2. The promisified version, dynogels-promisified of that package also has outdated dependencies. The PR submitted there is also almost a year.

The projects are great, so decided to combine the both projects and deploy it as dynogels-promise

Installation

> npm install dynogels-promise

Usage

All methods available in dynogels have been promisified and and can be assessed under the same name

Also Async versions of the methods that were available in dynogels-promisified are also available for backward-compatibility. So you can replace dynogels-promisified with this package, and will still work perfectly.

const dynogels = require('dynogels-promise')

const Todo = dynogels.define('Todo', {
  timestamps: true,
  hashKey: 'id',
  schema: {
    id: joi.string().required(),
    done: joi.boolean.default(false),
    content: joi.string().required()
  }
})

//=> Create Todo
const newTodo = await Todo.create({ id: uuid(), content: 'Write this doc' })
const newTodo = await Todo.createAsync({ id: uuid(), content: 'Write this doc' }) // backward compatibility

//=> Get a Todo item
const todo = await Todo.get('4549b30d-4a4a-4230-82d4-3286c9348d24')
const todo = await Todo.getAsync('4549b30d-4a4a-4230-82d4-3286c9348d24') // backward compatibility
1.0.21

3 years ago

1.0.20

4 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago