{"name":"dexie","version":"3.0.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 'Watching for file changes']","rollup -c ../tools/build-configs/rollup.config.js","rollup -c ../tools/build-configs/rollup.umd.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 'Watching for file changes']","rollup -c ../tools/build-configs/rollup.tests.config.js"]},"engines":{"node":">=6.0"},"homepage":"http://dexie.org","devDependencies":{"dts-bundle-generator":"^1.6.1","just-build":"^0.9.19","karma":"^5.1.1","karma-browserstack-launcher":"^1.5.2","karma-chrome-launcher":"^2.0.0","karma-firefox-launcher":"^1.3.0","karma-mocha-reporter":"^2.2.5","karma-qunit":"^4.1.1","qunit":"^2.10.0","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.4.0","rollup-plugin-sourcemaps":"^0.4.1","serve-static":"^1.14.1","tslib":"^1.11.2","typescript":"^3.8.3","uglify-js":"^3.9.2"},"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. Ambiguous 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 kick-ass performance. Its [bulk methods](http://dexie.org/docs/Table/Table.bulkPut()) take advantage of a lesser-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        this.friends = this.table(\"friends\");\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":"96c786981128c6c13fb0ac6b54236c9e1b0f1555","_id":"dexie@3.0.4","_nodeVersion":"14.19.0","_npmVersion":"8.5.3","dist":{"integrity":"sha512-rwS3k8BBstjGFJAS/yjYrsRZucqitnrP3NBhqghl9ihWcWABlT3I5f2dZV9T3pmXGAP7G9p1q00g/axcsuOT8A==","shasum":"18f5e124d525a413fa836716f2c37fbbc36a6662","tarball":"http://registry-npm.ywwl.com/dexie/download/dexie-3.0.4.tgz","fileCount":14,"unpackedSize":1445662,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5HGORHkW7ljAa/rp4OCzs2re6pajBsEAJSO2XThtryAIhALWVVz77DhXi9Y2epGaNHkcmjbtxOCjb5lcbQRHI1P5Z"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJia5HaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrVARAAjNBxqrnxT2RwL6MMO2TQ4z6LqLDm2BkooBQWQeWGWaZt8FBZ\r\nZmSCv7dkKmaslaJeSY2qxzsjJW2llzU7nVQKyQ57Q5uw+b9hrUUyDtISBRe4\r\nMj0570wFZBrCbQRgNUKzWxoo4pY3vqpey+Bva1TCeLYLhjdQHCkk8mzZbHSq\r\n2PiW6M6FXeveoP4ksKESSV9x6KesDVMaHy3/hkJ6niTyRaGOgZ4BRmRkR1+p\r\nv9x/4SdPyfVza9CItigee05djBunwnm2SZd7OxcO4hXDb82Afuy8Ar/Ola0J\r\njor0paDHc+dVXlTgsFN52vue+LwtGEMqB9hD+SWN5v3HzV5v3OD/S6YcHWys\r\nY+kBeOl+AKEtWEC8bhDDjUF4roU6Hj3aEzrPvJHgtGa5CwKoNMPnvkpCFzqX\r\n+V5ObLqwe/eHLg0f1lihawKnCR5jwFsbeoGC4y2gufkQsgdRI9RbQj7LPCC9\r\nwVUedP7uD2pVTtN4dXi0rC2L6SLPVC5I0M3GMu4Mr89+GzYUrbRVnMzZQn+K\r\nVXtmNIUhPLJL2WxaQm5apG9UekGB4be8WWjCtRa3Z6NdLaoNA3OS7CEqR/ID\r\nQlC3M/1lgvLlvibAW642E2V7BscM5tJKyIMQ0qSnzzt/3bXQbDcgzpzDbZXw\r\noXR8hBv4pZU85D+5r32TuqFksk9ulhq0CW4=\r\n=XIZ1\r\n-----END PGP SIGNATURE-----\r\n","size":346355,"noattachment":false,"key":"/dexie/-/dexie-3.0.4.tgz"},"_npmUser":{"name":"dfahlander","email":"david.fahlander@gmail.com"},"directories":{},"maintainers":[{"name":"anders.ekdahl","email":"anders.ekdahl@gmail.com"},{"name":"dfahlander","email":"david.fahlander@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dexie_3.0.4_1651216858092_0.3907158705460976"},"_hasShrinkwrap":false,"publish_time":1651216858366,"_cnpm_publish_time":1651216858366,"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"}}