{"name":"dexie","version":"3.2.2","description":"A Minimalistic Wrapper for IndexedDB","main":"dist/dexie.js","module":"dist/dexie.mjs","jsnext:main":"dist/dexie.mjs","exports":{".":{"production":{"browser":"./dist/modern/dexie.min.mjs","module":"./dist/modern/dexie.min.mjs","import":"./import-wrapper-prod.mjs","require":"./dist/dexie.min.js","default":"./dist/dexie.min.js"},"development":{"browser":"./dist/modern/dexie.mjs","module":"./dist/modern/dexie.mjs","import":"./import-wrapper.mjs","require":"./dist/dexie.js","default":"./dist/dexie.js"},"default":{"browser":"./dist/modern/dexie.mjs","module":"./dist/modern/dexie.mjs","import":"./import-wrapper.mjs","require":"./dist/dexie.js","default":"./dist/dexie.js"}},"./package.json":"./package.json"},"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']","tsc --target es2018 --outdir ../tools/tmp/modern/src/","rollup -c ../tools/build-configs/rollup.config.js","rollup -c ../tools/build-configs/rollup.umd.config.js","rollup -c ../tools/build-configs/rollup.modern.config.js","node ../tools/replaceVersionAndDate.js ../dist/dexie.js","node ../tools/replaceVersionAndDate.js ../dist/dexie.mjs","node ../tools/replaceVersionAndDate.js ../dist/modern/dexie.mjs","dts-bundle-generator --inline-declare-global --inline-declare-externals -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","# Minify modern bundle","cd modern","terser --comments false --compress --mangle --module --source-map -o dexie.min.mjs -- dexie.mjs"],"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":"https://dexie.org","devDependencies":{"dts-bundle-generator":"^5.9.0","just-build":"^0.9.19","karma":"^6.1.1","karma-browserstack-launcher":"^1.5.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-mocha-reporter":"^2.2.5","karma-qunit":"^4.1.1","qunit":"^2.10.0","qunitjs":"^1.23.1","rollup":"^2.40.0","rollup-plugin-cleanup":"^3.2.1","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.6.3","rxjs":"^6.6.6","safari-14-idb-fix":"^3.0.0","serve-static":"^1.14.1","sorted-json":"^0.2.6","terser":"^5.3.1","tslib":"^2.1.0","typescript":"^4.3.4","uglify-js":"^3.9.2"},"gitHead":"c698052360bd0b0d958ff38d74933f15f9f83909","_id":"dexie@3.2.2","_nodeVersion":"14.19.0","_npmVersion":"8.5.3","dist":{"integrity":"sha512-q5dC3HPmir2DERlX+toCBbHQXW5MsyrFqPFcovkH9N2S/UW/H3H5AWAB6iEOExeraAu+j+zRDG+zg/D7YhH0qg==","shasum":"fa6f2a3c0d6ed0766f8d97a03720056f88fe0e01","tarball":"http://registry-npm.ywwl.com/dexie/download/dexie-3.2.2.tgz","fileCount":20,"unpackedSize":2575488,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCO+ExIulepHZNxDl1JJa2NHIVc1H3I6lmb4BZA6X59zgIhAJoL/lJ2tSbqv8UmC8OwlWzU6erbUBqSU+6cOUuEnRSp"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaTrkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqtNhAAgw8Hk1Qg+ccK+SEXaAp8gCn6qPgiN1a2UpVwXTyEAjxOadmp\r\nrV0QwBootELYKtdyUu6V2IiZAHX/Za1CNtSF/tq6NPktk/CuC+wWTK1AzPmY\r\nenbNbaEraozDdR/sJsNIiPiLb72cFY/4AY/jgngbQNMHbFVaTSwdVLX9HhUP\r\nuYukD65M+cN6dq5vQqnVq9Lg/yOH3GoQaTFHl9xsPMOyPxBYVO/5GCth72HW\r\n5LM6yiyATcuEai/Dx7IN1X2st0wwHPrRVBiOsg4ktiLLEernzaz0OiSp6mHs\r\nbQ21ATFyHSU9hHqAKxd1l6FYkBtQYU7xG10vttuNolxsdMCxiJdY+vHIK9cM\r\nQVdL/1qKojCKKgYx19OTo5xCru4WELXqNTcnuSBIGOueC7wKb7BsnqNJN+S2\r\njjPR5Za5IVCQhR0UdeRUI+rO9B0umyLdWTgkYfJfGOOQRCLiSnsMgyOvxNKN\r\n/Dn1MLyURQhOmIM3FaYEnzPeN5tVqff1Ud8VKbG1+IAPwEbABFd/IXdpDwYP\r\nYeWMHkam+kl6tHRui5CUgC19Rj124ci80HWPbku9HKQVOIqrJ5WtI6NZfVvm\r\nEU6dvyDPQkk8VQXnPuj4ZYKAEEMbOkjO0eIPb7Da5IjEhKcU3BvfVvg3Gwrf\r\nEOnCZvAEdgiY0AO1xVt01XUpRQpMs/H8KDs=\r\n=Rn7Z\r\n-----END PGP SIGNATURE-----\r\n","size":627824,"noattachment":false,"key":"/dexie/-/dexie-3.2.2.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.2.2_1651063524743_0.7581143613735548"},"_hasShrinkwrap":false,"readme":"# Dexie.js\n\n[![NPM Version][npm-image]][npm-url] ![Build Status](https://github.com/dexie/Dexie.js/actions/workflows/main.yml/badge.svg)\n\nDexie.js is a wrapper library for indexedDB - the standard database in the browser. https://dexie.org.\n\n#### Why Dexie.js?\n\nIndexedDB is the portable database for all browser engines. Dexie.js makes it fun and easy to work with.\n\nBut also:\n\n* Dexie.js is widely used by 100,000 of web sites, apps and other projects and supports all browsers, Electron for Desktop apps, Capacitor for iOS / Android apps and of course pure PWAs.\n* Dexie.js works around bugs in the IndexedDB implementations, giving a more stable user experience.\n* It's an easy step to [make it sync](https://dexie.org/#sync).\n\n#### Hello World\n\n```html\n<!DOCTYPE html>\n<html>\n  <head>\n    <script src=\"https://unpkg.com/dexie/dist/dexie.js\"></script>\n    <script>\n\n      //\n      // Declare Database\n      //\n      const db = new Dexie('FriendDatabase');\n      db.version(1).stores({\n        friends: '++id, age'\n      });\n\n      //\n      // Play with it\n      //\n      db.friends.add({ name: 'Alice', age: 21 }).then(() => {\n        return db.friends\n          .where('age')\n          .below(30)\n          .toArray();\n      }).then(youngFriends => {\n        alert (`My young friends: ${JSON.stringify(youngFriends)}`);\n      }).catch (e => {\n        alert(`Oops: ${e}`);\n      });\n\n    </script>\n  </head>\n</html>\n```\n\nYes, it's that simple. Read [the docs](https://dexie.org/docs/) to get into the details.\n\n#### Hello World (for modern browsers)\n\nAll modern browsers support ES modules and top-level awaits. No transipler needed. Here's the previous example in a modern flavour:\n\n```html\n<!DOCTYPE html>\n<html>\n  <head>\n    <script type=\"module\">\n      // Import Dexie\n      import { Dexie } from 'https://unpkg.com/dexie/dist/modern/dexie.mjs';\n\n      //\n      // Declare Database\n      //\n      const db = new Dexie('FriendDatabase');\n      db.version(1).stores({\n        friends: '++id, age'\n      });\n\n      //\n      // Play with it\n      //\n      try {\n        await db.friends.add({ name: 'Alice', age: 21 });\n\n        const youngFriends = await db.friends\n            .where('age')\n            .below(30)\n            .toArray();\n\n        alert(`My young friends: ${JSON.stringify(youngFriends)}`);\n      } catch (e) {\n        alert(`Oops: ${e}`);\n      }\n    </script>\n  </head>\n</html>\n```\n\n#### Hello World (React + Typescript)\n\nReal-world apps are often built using components in various frameworks. Here's a version of Hello World written for React and Typescript. There are also links below this sample to more tutorials for different frameworks...\n\n```tsx\nimport React from 'react';\nimport { Dexie, type EntityTable } from 'dexie';\nimport { useLiveQuery } from 'dexie-react-hooks';\n\n// Typing for your entities (hint is to move this to its own module)\nexport interface Friend {\n  id: number;\n  name: string;\n  age: number;\n}\n\n// Database declaration (move this to its own module also)\nexport const db = new Dexie('FriendDatabase') as Dexie & {\n  friends: EntityTable<Friend, 'id'>;\n};\ndb.version(1).stores({\n  friends: '++id, age',\n});\n\n// Component:\nexport function MyDexieReactComponent() {\n  const youngFriends = useLiveQuery(() =>\n    db.friends\n      .where('age')\n      .below(30)\n      .toArray()\n  );\n\n  return (\n    <>\n      <h3>My young friends</h3>\n      <ul>\n        {youngFriends?.map((f) => (\n          <li key={f.id}>\n            Name: {f.name}, Age: {f.age}\n          </li>\n        ))}\n      </ul>\n      <button\n        onClick={() => {\n          db.friends.add({ name: 'Alice', age: 21 });\n        }}\n      >\n        Add another friend\n      </button>\n    </>\n  );\n}\n```\n\n[Tutorials for React, Svelte, Vue, Angular and vanilla JS](https://dexie.org/docs/Tutorial/Getting-started)\n\n[API Reference](https://dexie.org/docs/API-Reference)\n\n[Samples](https://dexie.org/docs/Samples)\n\n### Performance\n\nDexie has kick-ass performance. Its [bulk methods](<https://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\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```\n\nThis is a mix of methods from [WhereClause](https://dexie.org/docs/WhereClause/WhereClause), [Table](https://dexie.org/docs/Table/Table) and [Collection](https://dexie.org/docs/Collection/Collection). Dive into the [API reference](https://dexie.org/docs/API-Reference) to see the details.\n\n## Dexie Cloud\n\n[Dexie Cloud](https://dexie.org/cloud/) is a commercial offering that can be used as an add-on to Dexie.js. It syncs a Dexie database with a server and enables developers to build apps without having to care about backend or database layer else than the frontend code with Dexie.js as the sole database layer.\n\nSource for a sample Dexie Cloud app: [Dexie Cloud To-do app](https://github.com/dexie/Dexie.js/tree/master/samples/dexie-cloud-todo-app)\n\nSee the sample Dexie Cloud app in action: https://dexie.github.io/Dexie.js/dexie-cloud-todo-app/\n\n## Samples\n\nhttps://dexie.org/docs/Samples\n\nhttps://github.com/dexie/Dexie.js/tree/master/samples\n\n## Knowledge Base\n\n[https://dexie.org/docs/Questions-and-Answers](https://dexie.org/docs/Questions-and-Answers)\n\n## Website\n\n[https://dexie.org](https://dexie.org)\n\n## Install via npm\n\n```\nnpm install dexie\n```\n\n## Download\n\nFor those who don't like package managers, here's the download links:\n\n### UMD (for legacy script includes as well as commonjs require):\n\nhttps://unpkg.com/dexie@latest/dist/dexie.min.js\n\nhttps://unpkg.com/dexie@latest/dist/dexie.min.js.map\n\n### Modern (ES module):\n\nhttps://unpkg.com/dexie@latest/dist/modern/dexie.min.mjs\n\nhttps://unpkg.com/dexie@latest/dist/modern/dexie.min.mjs.map\n\n### Typings:\n\nhttps://unpkg.com/dexie@latest/dist/dexie.d.ts\n\n# Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## Build\n\n```\npnpm install\npnpm run build\n```\n\n## Test\n\n```\npnpm test\n```\n\n## Watch\n\n```\npnpm run watch\n```\n\n<br/>\n\n[![Browser testing via LAMDBATEST](https://dexie.org/assets/images/lambdatest2.png)](https://www.lambdatest.com/)\n\n[npm-image]: https://img.shields.io/npm/v/dexie.svg?style=flat\n[npm-url]: https://npmjs.org/package/dexie\n","publish_time":1651063524960,"_cnpm_publish_time":1651063524960,"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"}}