{"name":"dexie","version":"3.0.0-alpha.4","description":"A Minimalistic Wrapper for IndexedDB","main":"dist/dexie.js","module":"dist/dexie.mjs","jsnext:main":"dist/dexie.mjs","typings":"dist/dexie.d.ts","jspm":{"format":"cjs","ignore":["src/"]},"repository":{"type":"git","url":"git+https://github.com/dfahlander/Dexie.js.git"},"keywords":["indexeddb","browser","database"],"author":{"name":"David Fahlander","email":"https://github.com/dfahlander"},"contributors":[{"name":"Christopher Hunt","email":"https://github.com/chrahunt"},{"name":"Nikolas Poniros","email":"https://github.com/nponiros"},{"name":"Anders Ekdahl","email":"https://github.com/andersekdahl"},{"name":"Yury Solovyov","email":"https://github.com/YurySolovyov"},{"name":"Martin Diphoorn","email":"https://github.com/martindiphoorn"}],"license":"Apache-2.0","bugs":{"url":"https://github.com/dfahlander/Dexie.js/issues"},"scripts":{"build":"just-build","watch":"just-build --watch","clean":"rm -rf tools/tmp && rm dist/*.js && rm dist/*.map && rm dist/*.ts && rm dist/*.mjs","test":"npm run build && npm run test:typings && npm run test:unit","test:unit":"karma start test/karma.conf.js --single-run","test:typings":"tsc -p test/typings-test/","test:debug":"karma start test/karma.conf.js --log-level debug"},"just-build":{"default":["# Build all targets (es5, es6 and test) and minify the default es5 UMD module","just-build release test"],"dexie":["# Build dist/dexie.js, dist/dexie.mjs and dist/dexie.d.ts","cd src","tsc [--watch 'Compilation complete.']","rollup -c ../tools/build-configs/rollup.config.js","node ../tools/replaceVersionAndDate.js ../dist/dexie.js","node ../tools/replaceVersionAndDate.js ../dist/dexie.mjs","dts-bundle-generator --umd-module-name Dexie -o ../dist/dexie.d.ts public/index.d.ts","node ../tools/prepend.js ../dist/dexie.d.ts ../tools/build-configs/banner.txt","node ../tools/replaceVersionAndDate.js ../dist/dexie.d.ts"],"release":["# Build ES5 umd module as well as the es6 module.","just-build dexie","node tools/replaceVersionAndDate.js dist/dexie.d.ts","# Minify the default ES5 UMD module","cd dist","uglifyjs dexie.js -m -c negate_iife=0 -o dexie.min.js --source-map"],"dev":["# Build ES5 module and the tests","just-build dexie test"],"gzip":["# Optionally gzip to find the size of the minified & gzipped version","gzip dist/dexie.min.js -k -f -9"],"test":["# Build the test suite.","cd test","tsc [--watch 'Compilation complete.']","rollup -c ../tools/build-configs/rollup.tests.config.js"]},"engines":{"node":">=6.0"},"homepage":"http://dexie.org","devDependencies":{"dts-bundle-generator":"^1.2.2","just-build":"^0.9.16","karma":"^3.0.0","karma-browserstack-launcher":"^1.3.0","karma-chrome-launcher":"^2.0.0","karma-firefox-launcher":"^1.1.0","karma-mocha-reporter":"^2.2.5","karma-qunit":"^1.2.1","qunit":"^2.6.2","qunitjs":"^1.23.1","rollup":"^0.55.5","rollup-plugin-cleanup":"^2.0.1","rollup-plugin-commonjs":"^8.4.1","rollup-plugin-node-resolve":"^3.3.0","rollup-plugin-sourcemaps":"^0.4.1","serve-static":"^1.13.2","tslib":"^1.9.1","typescript":"^2.8.3","uglify-js":"^3.3.27"},"dependencies":{},"readme":"Dexie.js\n========\n\n[![NPM Version][npm-image]][npm-url] [![Build Status](https://travis-ci.org/dfahlander/Dexie.js.svg?branch=master)](https://travis-ci.org/dfahlander/Dexie.js)[![Tested with Browserstack](http://dexie.org/assets/images/tested-with-browserstack2.png)](https://www.browserstack.com)\n\nDexie.js is a wrapper library for indexedDB - the standard database in the browser. http://dexie.org\n\n#### Why?\nDexie solves three main issues with the native IndexedDB API:\n\n 1. Ambivalent error handling\n 2. Poor queries\n 3. Code complexity\n\nDexie provides a neat database API with a well thought-through API design, robust error handling, extendability, change tracking awareness and extended KeyRange support (case insensitive search, set matches and OR operations).\n\n#### Hello World\n\n```html\n<!doctype html>\n<html>\n <head>\n  <script src=\"https://unpkg.com/dexie@latest/dist/dexie.js\"></script>\n  <script>\n   //\n   // Declare Database\n   //\n   var db = new Dexie(\"FriendDatabase\");\n   db.version(1).stores({\n     friends: \"++id,name,age\"\n   });\n\n   //\n   // Manipulate and Query Database\n   //\n   db.friends.add({name: \"Josephine\", age: 21}).then(function() {\n       return db.friends.where(\"age\").below(25).toArray();\n   }).then(function (youngFriends) {\n       alert (\"My young friends: \" + JSON.stringify(youngFriends));\n   }).catch(function (e) {\n       alert (\"Error: \" + (e.stack || e));\n   });\n  </script>\n </head>\n</html>\n```\nYes, it's that simple.\n\n[Tutorial](http://dexie.org/docs/Tutorial)\n\n[API Reference](http://dexie.org/docs/API-Reference)\n\n[Samples](http://dexie.org/docs/Samples)\n\n### Performance\n\nDexie has a kick-ass performance. It's [bulk methods](http://dexie.org/docs/Table/Table.bulkPut()) take advantage of a not well known feature in indexedDB that makes it possible to store stuff without listening to every onsuccess event. This speeds up the performance to a maximum.\n\n#### Supported operations\n```js\nabove(key): Collection;\naboveOrEqual(key): Collection;\nadd(item, key?): Promise;\nand(filter: (x) => boolean): Collection;\nanyOf(keys[]): Collection;\nanyOfIgnoreCase(keys: string[]): Collection;\nbelow(key): Collection;\nbelowOrEqual(key): Collection;\nbetween(lower, upper, includeLower?, includeUpper?): Collection;\nbulkAdd(items: Array): Promise;\nbulkDelete(keys: Array): Promise;\nbulkPut(items: Array): Promise;\nclear(): Promise;\ncount(): Promise;\ndelete(key): Promise;\ndistinct(): Collection;\neach(callback: (obj) => any): Promise;\neachKey(callback: (key) => any): Promise;\neachPrimaryKey(callback: (key) => any): Promise;\neachUniqueKey(callback: (key) => any): Promise;\nequals(key): Collection;\nequalsIgnoreCase(key): Collection;\nfilter(fn: (obj) => boolean): Collection;\nfirst(): Promise;\nget(key): Promise;\ninAnyRange(ranges): Collection;\nkeys(): Promise;\nlast(): Promise;\nlimit(n: number): Collection;\nmodify(changeCallback: (obj: T, ctx:{value: T}) => void): Promise;\nmodify(changes: { [keyPath: string]: any } ): Promise;\nnoneOf(keys: Array): Collection;\nnotEqual(key): Collection;\noffset(n: number): Collection;\nor(indexOrPrimayKey: string): WhereClause;\norderBy(index: string): Collection;\nprimaryKeys(): Promise;\nput(item: T, key?: Key): Promise;\nreverse(): Collection;\nsortBy(keyPath: string): Promise;\nstartsWith(key: string): Collection;\nstartsWithAnyOf(prefixes: string[]): Collection;\nstartsWithAnyOfIgnoreCase(prefixes: string[]): Collection;\nstartsWithIgnoreCase(key: string): Collection;\ntoArray(): Promise;\ntoCollection(): Collection;\nuniqueKeys(): Promise;\nuntil(filter: (value) => boolean, includeStopEntry?: boolean): Collection;\nupdate(key: Key, changes: { [keyPath: string]: any }): Promise;\n```\nThis is a mix of methods from [WhereClause](http://dexie.org/docs/WhereClause/WhereClause), [Table](http://dexie.org/docs/Table/Table) and [Collection](http://dexie.org/docs/Collection/Collection). Dive into the [API reference](http://dexie.org/docs/API-Reference) to see the details.\n\n#### Hello World (ES2016 / ES7)\n```js\nimport Dexie from 'dexie';\n\n//\n// Declare Database\n//\nconst db = new Dexie(\"FriendDatabase\");\ndb.version(1).stores({ friends: \"++id,name,age\" });\n\ndb.transaction('rw', db.friends, async() => {\n\n    // Make sure we have something in DB:\n    if ((await db.friends.where({name: 'Josephine'}).count()) === 0) {\n        const id = await db.friends.add({name: \"Josephine\", age: 21});\n        alert (`Addded friend with id ${id}`);\n    }\n\n    // Query:\n    const youngFriends = await db.friends.where(\"age\").below(25).toArray();\n\n    // Show result:\n    alert (\"My young friends: \" + JSON.stringify(youngFriends));\n\n}).catch(e => {\n    alert(e.stack || e);\n});\n\n```\n\n#### Hello World (Typescript)\n\n```js\nimport Dexie from 'dexie';\n\ninterface Friend {\n    id?: number;\n    name?: string;\n    age?: number;\n}\n\n//\n// Declare Database\n//\nclass FriendDatabase extends Dexie {\n    public friends!: Dexie.Table<Friend, number>; // id is number in this case\n\n    public constructor() {\n        super(\"FriendDatabase\");\n        this.version(1).stores({\n            friends: \"++id,name,age\"\n        });\n    }\n}\n\nconst db = new FriendDatabase();\n\ndb.transaction('rw', db.friends, async() => {\n\n    // Make sure we have something in DB:\n    if ((await db.friends.where({name: 'Josephine'}).count()) === 0) {\n        const id = await db.friends.add({name: \"Josephine\", age: 21});\n        alert (`Addded friend with id ${id}`);\n    }\n\n    // Query:\n    const youngFriends = await db.friends.where(\"age\").below(25).toArray();\n\n    // Show result:\n    alert (\"My young friends: \" + JSON.stringify(youngFriends));\n\n}).catch(e => {\n    alert(e.stack || e);\n});\n```\n\nSamples\n-------\nhttp://dexie.org/docs/Samples\n\nhttps://github.com/dfahlander/Dexie.js/tree/master/samples\n\nKnowledge Base\n-----\n[http://dexie.org/docs/Questions-and-Answers](http://dexie.org/docs/Questions-and-Answers)\n\nWebsite\n-------\n[http://dexie.org](http://dexie.org)\n\nInstall over npm\n----------------\n```\nnpm install dexie\n```\n\n\nDownload\n--------\nFor those who don't like package managers, here's the download links:\n\nhttps://unpkg.com/dexie@latest/dist/dexie.js\n\nhttps://unpkg.com/dexie@latest/dist/dexie.js.map\n\nhttps://unpkg.com/dexie@latest/dist/dexie.d.ts\n\n\nContributing\n============\nHere is a little cheat-sheet for how to symlink your app's `node_modules/dexie` to a place where you can edit the source, version control your changes and create pull requests back to Dexie. Assuming you've already ran `npm install dexie --save` for the app your are developing.\n\n1. Fork Dexie.js from the web gui on github\n2. Clone your fork locally by launching a shell/command window and cd to a neutral place (like `~repos/`, `c:\\repos` or whatever)\n3. Run the following commands:\n\n    ```\n    git clone https://github.com/YOUR-USERNAME/Dexie.js.git dexie\n    cd dexie\n    npm install\n    npm run build\n    npm link\n    ```\n3. cd to your app directory and write:\n    ```\n    npm link dexie\n    ```\n\nYour app's `node_modules/dexie/` is now sym-linked to the Dexie.js clone on your hard drive so any change you do there will propagate to your app. Build dexie.js using `npm run build` or `npm run watch`. The latter will react on any source file change and rebuild the dist files.\n\nThat's it. Now you're up and running to test and commit changes to files under dexie/src/* or dexie/test/* and the changes will instantly affect the app you are developing.\n\nPull requests are more than welcome. Some advices are:\n\n* Run npm test before making a pull request.\n* If you find an issue, a unit test that reproduces it is lovely ;). If you don't know where to put it, put it in `test/tests-misc.js`. We use qunit. Just look at existing tests in `tests-misc.js` to see how they should be written. Tests are transpiled in the build script so you can use ES6 if you like.\n\nBuild\n-----\n```\nnpm install\nnpm run build\n```\n\nTest\n----\n```\nnpm test\n```\n\nWatch\n-----\n```\nnpm run watch\n```\n\n\n[npm-image]: https://img.shields.io/npm/v/dexie.svg?style=flat\n[npm-url]: https://npmjs.org/package/dexie\n","readmeFilename":"README.md","gitHead":"0cfce2c8bf7fd383ab72251af0a1ed37df70b71b","_id":"dexie@3.0.0-alpha.4","_npmVersion":"6.4.1","_nodeVersion":"8.11.4","_npmUser":{"name":"dfahlander","email":"david.fahlander@gmail.com"},"dist":{"integrity":"sha512-uwRUibvWTxzHRMLKQ4DHSNhJa0v+n/bSZduhdDOQfLvyQX/JApaE93KZhCWoo8WyOfyo3r4yd7fcESQ6KkL83w==","shasum":"ba90f11152ec3d51a4ead0f132ce21bfbe9f6aec","tarball":"http://registry-npm.ywwl.com/dexie/download/dexie-3.0.0-alpha.4.tgz","fileCount":13,"unpackedSize":1374565,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzsr3CRA9TVsSAnZWagAArVoP/RGWTmgd/s+PfLV0H6RE\nzwLFGIAB77t/8GmC5FebIwWlneBm4e38l6xxT4tfYsdRQ/RkLSQAfxSs/fEU\n8t5EgWW/sbOUBMS4uVgbZfWD2ChSIvzmGWZ6so61rVxmBcaTkKq6PJSjVIjI\n28wrq5ydW8GOTNdAsPDml9dOD+gfLF69z+haeDUdx7dMheHrXk234la0di56\nosDGU6hHAxo6OwceNScl/t4iSjUh+l+s2ZGCCXGzlc2k3cMhtk4gBncTQBqi\nV/BG71NMIR3dcRs6bkI+zrHbZbSjK9K793GfLhpzZt90vz7nzAUcAJTw1PUq\nmjGtwZEkAiBfUmkLho/HlxAhP9dPFj0eM2o2MbM6oaoQSxr9I1LtABRRGUOP\nUyF1MC4ikQyDdDuAdYjt6oPvLF79gU1BoX6ZdQYUSThiWxbf9Dz4XMz78OaB\nljCe6Jc2KuZqjyc0J6hn3aWXRWLxVJPDOJ4H7zUjEV4Tzjrfhaix+D43riY9\njp3IzQUyGA7H1Hzk6bva9qt6EPTEmRtBBiyLd9tXwFRrSEiafwChIIEsO2Z/\nbJQ3g7ODwxG7uJnjpN/QSLwfOnUNYIe7J4h8exNxNcwpgzBsTeaa+7b/OTdN\np+z5XvlV8iaArNtMzGtsVmr89+RqTwFN2q295x2t2kZIZjuRNgLq9s4XmFyj\n/FVC\r\n=wLdP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGKZVBZOleDoFy+Kf665Rz7MYXf4YdZy9ro+4iLsZwlYAiAArSf4lrwk8o76hCDtbuuWXhv/eXtPgbCtBChRW0uwug=="}],"size":334889,"noattachment":false,"key":"/dexie/-/dexie-3.0.0-alpha.4.tgz"},"maintainers":[{"name":"anders.ekdahl","email":"anders.ekdahl@gmail.com"},{"name":"dfahlander","email":"david.fahlander@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dexie_3.0.0-alpha.4_1540279031076_0.13842131504701394"},"_hasShrinkwrap":false,"publish_time":1540279031263,"_cnpm_publish_time":1540279031263,"dist-tags":{"dev":"4.4.7","latest":"4.4.7","latest-3":"3.2.7","latest-3.0.x":"3.0.4","pr2297":"4.4.2-pr2297.4"}}