{"name":"dexie","version":"2.0.1","description":"A Minimalistic Wrapper for IndexedDB","main":"dist/dexie.js","module":"dist/dexie.es.js","jsnext:main":"dist/dexie.es.js","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","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 es5 output","tsc --allowJs -t es5 -m es2015 --outDir tools/tmp/es5/src/ --sourceMap src/Dexie.js [--watch 'Compilation complete.']","rollup -c tools/build-configs/rollup.config.js","node tools/replaceVersionAndDate.js dist/dexie.js","eslint src"],"release":["# Build ES5 umd module as well as the es6 module.","just-build dexie","# Copy Dexie.d.ts to dist and replace version in it","node -e \"fs.writeFileSync('dist/dexie.d.ts', fs.readFileSync('src/Dexie.d.ts'))\"","node tools/replaceVersionAndDate.js dist/dexie.d.ts","# Minify the default ES5 UMD module","cd dist","uglifyjs dexie.js -m -c -o dexie.min.js --source-map dexie.min.js.map  --in-source-map dexie.js.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. Typescript transpiles all but not generators...","tsc --allowJs -t es5 -m es2015 --outDir tools/tmp/es5/test/ --rootDir . --sourceMap test/tests-all.js [--watch 'Compilation complete.']","rollup -c tools/build-configs/rollup.tests.config.js","# As a last step, let babel transpile the generators....","babel tools/tmp/es5/test/bundle.js -o test/bundle.js --plugins transform-regenerator --source-maps"]},"engines":{"node":">=6.0"},"homepage":"http://dexie.org","devDependencies":{"babel-cli":"^6.18.0","babel-plugin-transform-regenerator":"^6.21.0","eslint":"^3.7.1","just-build":"^0.9.16","karma":"^1.4.0","karma-browserstack-launcher":"^1.1.1","karma-chrome-launcher":"^2.0.0","karma-firefox-launcher":"^1.0.0","karma-mocha-reporter":"^2.2.2","karma-qunit":"^1.2.1","qunit":"^0.7.7","qunitjs":"^1.23.1","rollup":"^0.41.4","rollup-plugin-commonjs":"^7.0.0","rollup-plugin-node-resolve":"^2.0.0","rollup-plugin-sourcemaps":"^0.4.1","serve-static":"^1.11.1","typescript":"^2.1.4","uglify-js":"^2.7.5"},"dependencies":{},"gitHead":"5baf5ccd73d7ac23c5e5ee6f3af65a59b0fe7e88","_id":"dexie@2.0.1","_shasum":"a6dc4e607461c4da5f934621917a2a8939a18e97","_from":".","_npmVersion":"3.10.6","_nodeVersion":"6.5.0","_npmUser":{"name":"dfahlander","email":"david.fahlander@gmail.com"},"dist":{"shasum":"a6dc4e607461c4da5f934621917a2a8939a18e97","tarball":"http://registry-npm.ywwl.com/dexie/download/dexie-2.0.1.tgz","integrity":"sha512-i4G37IiTyz6hQFe0dbEXLC3ZK/ulsSAQSb6owsefTsgoPOXL6CZWia63OopIL/46D17QDcxw/SvgMeNV6Yku0Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhHJUPqKv6fGYJ2EqXvZMPQPQA8rsALN0WxBziKdH9FgIgfQCGK0pCjqdwCADVlmU43Jp5vo/Q6hxsy5w2tztoyO0="}],"size":379660,"noattachment":false,"key":"/dexie/-/dexie-2.0.1.tgz"},"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-2.0.1.tgz_1506950478002_0.6391788532491773"},"directories":{},"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":1506950479508,"_cnpm_publish_time":1506950479508,"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"}}