Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
feat: idb datastore
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias committed Mar 31, 2020
0 parents commit 336c7e7
Show file tree
Hide file tree
Showing 8 changed files with 560 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
docs
package-lock.json
yarn.lock
**/node_modules/
**/*.log
test/repo-tests*
test/test-repo/datastore/*

# Logs
logs
*.log

coverage

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

build

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

lib
dist
test/test-repo/datastore
init-default
datastore-test
.vscode
41 changes: 41 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
language: node_js
cache: npm
stages:
- check
- test
- cov

node_js:
- '10'
- '12'

os:
- linux
- osx
- windows

script: npx nyc -s npm run test:node -- --bail
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov

jobs:
include:
- stage: check
script:
- npx aegir commitlint --travis
- npx aegir dep-check
- npm run lint

- stage: test
name: chrome
addons:
chrome: stable
script: npx aegir test -t browser -t webworker

- stage: test
name: firefox
addons:
firefox: latest
script: npx aegir test -t browser -t webworker -- --browsers FirefoxHeadless

notifications:
email: false
155 changes: 155 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
<a name="0.14.1"></a>
## [0.14.1](https://github.com/ipfs/js-datastore-level/compare/v0.14.0...v0.14.1) (2020-01-14)


### Bug Fixes

* leveldb iterator memory leak ([#26](https://github.com/ipfs/js-datastore-level/issues/26)) ([e503c1a](https://github.com/ipfs/js-datastore-level/commit/e503c1a)), closes [/github.com/Level/leveldown/blob/d3453fbde4d2a8aa04d9091101c25c999649069b/binding.cc#L545](https://github.com//github.com/Level/leveldown/blob/d3453fbde4d2a8aa04d9091101c25c999649069b/binding.cc/issues/L545)


### Performance Improvements

* optimize prefix search ([#25](https://github.com/ipfs/js-datastore-level/issues/25)) ([8efa812](https://github.com/ipfs/js-datastore-level/commit/8efa812))



<a name="0.14.0"></a>
# [0.14.0](https://github.com/ipfs/js-datastore-level/compare/v0.13.0...v0.14.0) (2019-11-29)



<a name="0.13.0"></a>
# [0.13.0](https://github.com/ipfs/js-datastore-level/compare/v0.12.1...v0.13.0) (2019-11-29)


### Bug Fixes

* init db in overridable method for easier extending ([#21](https://github.com/ipfs/js-datastore-level/issues/21)) ([b21428c](https://github.com/ipfs/js-datastore-level/commit/b21428c))



<a name="0.12.1"></a>
## [0.12.1](https://github.com/ipfs/js-datastore-level/compare/v0.12.0...v0.12.1) (2019-06-26)


### Bug Fixes

* swap leveldown/level.js for level ([#20](https://github.com/ipfs/js-datastore-level/issues/20)) ([d16e212](https://github.com/ipfs/js-datastore-level/commit/d16e212))



<a name="0.12.0"></a>
# [0.12.0](https://github.com/ipfs/js-datastore-level/compare/v0.11.0...v0.12.0) (2019-05-29)


### Bug Fixes

* remove unused var ([74d4a36](https://github.com/ipfs/js-datastore-level/commit/74d4a36))
* tests ([601599d](https://github.com/ipfs/js-datastore-level/commit/601599d))



<a name="0.11.0"></a>
# [0.11.0](https://github.com/ipfs/js-datastore-level/compare/v0.10.0...v0.11.0) (2019-04-29)



<a name="0.10.0"></a>
# [0.10.0](https://github.com/ipfs/js-datastore-level/compare/v0.9.0...v0.10.0) (2018-10-24)



<a name="0.9.0"></a>
# [0.9.0](https://github.com/ipfs/js-datastore-level/compare/v0.8.0...v0.9.0) (2018-09-19)


### Features

* add basic error codes ([02a5146](https://github.com/ipfs/js-datastore-level/commit/02a5146))



<a name="0.8.0"></a>
# [0.8.0](https://github.com/ipfs/js-datastore-level/compare/v0.7.0...v0.8.0) (2018-05-29)


### Bug Fixes

* add test and fix constructor ([396f657](https://github.com/ipfs/js-datastore-level/commit/396f657))
* update binary encoding for levelup 2 ([a5d7378](https://github.com/ipfs/js-datastore-level/commit/a5d7378))
* upgrade level libs to resolve node 10 failure ([a427eca](https://github.com/ipfs/js-datastore-level/commit/a427eca))



<a name="0.7.0"></a>
# [0.7.0](https://github.com/ipfs/js-datastore-level/compare/v0.6.0...v0.7.0) (2017-11-06)


### Bug Fixes

* Windows interop ([#4](https://github.com/ipfs/js-datastore-level/issues/4)) ([5d67042](https://github.com/ipfs/js-datastore-level/commit/5d67042))



<a name="0.6.0"></a>
# [0.6.0](https://github.com/ipfs/js-datastore-level/compare/v0.5.0...v0.6.0) (2017-07-23)



<a name="0.5.0"></a>
# [0.5.0](https://github.com/ipfs/js-datastore-level/compare/v0.4.2...v0.5.0) (2017-07-22)



<a name="0.4.2"></a>
## [0.4.2](https://github.com/ipfs/js-datastore-level/compare/v0.4.0...v0.4.2) (2017-05-24)


### Bug Fixes

* Object.assign is now evil and no longer is behaving as spec says when Webpacked ([5e40f3b](https://github.com/ipfs/js-datastore-level/commit/5e40f3b))
* Object.assign is now evil and no longer is behaving as spec says when Webpacked ([c3f50ec](https://github.com/ipfs/js-datastore-level/commit/c3f50ec))



<a name="0.4.1"></a>
## [0.4.1](https://github.com/ipfs/js-datastore-level/compare/v0.4.0...v0.4.1) (2017-05-24)


### Bug Fixes

* Object.assign is now evil and no longer is behaving as spec says when Webpacked ([077bbc1](https://github.com/ipfs/js-datastore-level/commit/077bbc1))



<a name="0.4.0"></a>
# [0.4.0](https://github.com/ipfs/js-datastore-level/compare/v0.3.0...v0.4.0) (2017-05-23)



<a name="0.3.0"></a>
# [0.3.0](https://github.com/ipfs/js-datastore-level/compare/v0.2.0...v0.3.0) (2017-03-23)



<a name="0.2.0"></a>
# [0.2.0](https://github.com/ipfs/js-datastore-level/compare/v0.1.0...v0.2.0) (2017-03-23)


### Features

* add open method ([fd12c6b](https://github.com/ipfs/js-datastore-level/commit/fd12c6b))



<a name="0.1.0"></a>
# 0.1.0 (2017-03-15)


### Bug Fixes

* key handling ([682f8b3](https://github.com/ipfs/js-datastore-level/commit/682f8b3))
* working interop with go ([f5e03c6](https://github.com/ipfs/js-datastore-level/commit/f5e03c6))



21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Protocol Labs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# js-datastore-idb

[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
[![Build Status](https://flat.badgen.net/travis/ipfs/js-datastore-idb)](https://travis-ci.com/ipfs/js-datastore-idb)
[![Codecov](https://codecov.io/gh/ipfs/js-datastore-idb/branch/master/graph/badge.svg)](https://codecov.io/gh/ipfs/js-datastore-idb)
[![Dependency Status](https://david-dm.org/ipfs/js-datastore-idb.svg?style=flat-square)](https://david-dm.org/ipfs/js-datastore-idb)


> Datastore implementation with IndexedDB backend.
## Lead Maintainer

[Hugo Dias](https://github.com/hugomrdias)

## Install

```
$ npm install datastore-idb
```

## Usage

```js
const IdbStore = require('datastore-idb')

const store = new IdbStore('path/to/store')
```

## Contribute

Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-datastore-level/issues)!

This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).

[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md)

## License

[MIT](LICENSE)
41 changes: 41 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "datastore-idb",
"version": "0.0.0",
"description": "Datastore implementation with IndexedDB backend.",
"leadMaintainer": "Hugo Dias <hugomrdias@gmail.com>",
"main": "src/index.js",
"scripts": {
"test": "aegir test -t browser -t webworker",
"test:browser": "aegir test -t browser",
"test:webworker": "aegir test -t webworker",
"build": "aegir build",
"lint": "aegir lint",
"release": "aegir release",
"release-minor": "aegir release --type minor",
"release-major": "aegir release --type major",
"coverage": "nyc -s npm run test:node && nyc report --reporter=html",
"dep-check": "aegir dep-check"
},
"repository": "github:ipfs/js-datastore-idb",
"keywords": [
"interface",
"key-value",
"ipfs",
"datastore",
"browser",
"idb"
],
"author": "Hugo Dias <hugomrdias@gmail.com>",
"license": "MIT",
"bugs": "https://github.com/ipfs/js-datastore-idb/issues",
"homepage": "https://github.com/ipfs/js-datastore-idb#readme",
"dependencies": {
"buffer": "hugomrdias/level#fix/add-buffer",
"idb": "^5.0.2",
"interface-datastore": "ipfs/interface-datastore#fix/remove-node-globals"
},
"devDependencies": {
"datastore-core": "ipfs/js-datastore-core#fix/add-buffer",
"aegir": "^21.4.5"
}
}
Loading

0 comments on commit 336c7e7

Please sign in to comment.