Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amazingandyyy/levelize
Better leveldb usage.
https://github.com/amazingandyyy/levelize
database level leveldb nosql scratchese
Last synced: 19 days ago
JSON representation
Better leveldb usage.
- Host: GitHub
- URL: https://github.com/amazingandyyy/levelize
- Owner: amazingandyyy
- License: mit
- Created: 2019-08-16T04:57:53.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T12:16:16.000Z (almost 3 years ago)
- Last Synced: 2024-10-12T18:53:34.368Z (about 1 month ago)
- Topics: database, level, leveldb, nosql, scratchese
- Language: JavaScript
- Homepage:
- Size: 185 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
🎁 levelize
Use leveldb just like mongo.> open source!
## Installation
```shell
$ npm i --save @amazingandyyy/levelize
# or
$ yarn add @amazingandyyy/levelize
```## Usage
```javascript
const process = require('process')
const level = require('level')
const Levelize = require('@amazingandyyy/levelize')const levelize = new Levelize(level)
levelize.connect('levelize-demo-2019', {
location: process.cwd()
})const UserShema = levelize.schema({
username: String,
password: String,
email: String
})const userModel = levelize.model('User', UserShema)
for (let i = 0; i < 10; i++) {
userModel.createOne({
username: `amazingandyyy-${i}@gmail.com`, password: `xx${i}xx`
})
}
userModel.getAll()userModel.getOne({
username: `[email protected]`
}, (err, user) => {
console.log(err, user)
})```
## License
MIT