{"id":23392813,"url":"https://github.com/leegeunhyeok/bxd","last_synced_at":"2025-04-11T11:41:28.454Z","repository":{"id":48606062,"uuid":"320437996","full_name":"leegeunhyeok/bxd","owner":"leegeunhyeok","description":"📦 Object relational mapping for IndexedDB","archived":false,"fork":false,"pushed_at":"2022-05-23T06:28:29.000Z","size":3039,"stargazers_count":27,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"dev","last_synced_at":"2025-03-25T08:02:08.963Z","etag":null,"topics":["boxdb","bxd","database","idb","indexeddb","orm"],"latest_commit_sha":null,"homepage":"https://bxd.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leegeunhyeok.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-11T01:49:33.000Z","updated_at":"2025-01-23T18:14:31.000Z","dependencies_parsed_at":"2022-09-16T00:40:42.192Z","dependency_job_id":null,"html_url":"https://github.com/leegeunhyeok/bxd","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leegeunhyeok%2Fbxd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leegeunhyeok%2Fbxd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leegeunhyeok%2Fbxd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leegeunhyeok%2Fbxd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leegeunhyeok","download_url":"https://codeload.github.com/leegeunhyeok/bxd/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248385507,"owners_count":21094900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boxdb","bxd","database","idb","indexeddb","orm"],"created_at":"2024-12-22T05:16:05.517Z","updated_at":"2025-04-11T11:41:28.423Z","avatar_url":"https://github.com/leegeunhyeok.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# bxd\n\n\u003cimg alt=\"bxd\" src=\"./bxd.gif\"\u003e\n\nBoxDB is a promise-based browser ORM for [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API)\n\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/leegeunhyeok/bxd/actions?query=workflow:build\" alt=\"Github actions\"\u003e\n    \u003cimg src=\"https://github.com/leegeunhyeok/bxd/workflows/build/badge.svg\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://www.codefactor.io/repository/github/leegeunhyeok/bxd\"\u003e\n     \u003cimg src=\"https://www.codefactor.io/repository/github/leegeunhyeok/bxd/badge\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://lgtm.com/projects/g/leegeunhyeok/bxd/context:javascript\" alt=\"lgtm\"\u003e\n    \u003cimg src=\"https://img.shields.io/lgtm/grade/javascript/g/leegeunhyeok/bxd.svg?logo=lgtm\u0026logoWidth=18\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/leegeunhyeok/bxd\" alt=\"codecov\"\u003e\n    \u003cimg src=\"https://codecov.io/gh/leegeunhyeok/bxd/branch/dev/graph/badge.svg?token=I5YZWY8PGT\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://www.npmjs.com/package/bxd\" alt=\"npm\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/bxd\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/bxd\"\u003e\n    \u003cimg alt=\"npm bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/bxd\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/bxd\"\u003e\n    \u003cimg alt=\"npm bundle size\" src=\"https://img.shields.io/bundlephobia/min/bxd\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/bxd\"\u003e\n    \u003cimg alt=\"zero dependency\" src=\"https://badgen.net/bundlephobia/dependency-count/bxd\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  \u003cimg src=\"https://img.shields.io/github/license/leegeunhyeok/bxd\"\u003e\n  \u003cimg src=\"https://badgen.net/badge/-/TypeScript/blue?icon=typescript\u0026label\" alt=\"typescript\"\u003e\n\n\u003c/div\u003e\n\n```typescript\nimport BoxDB from 'bxd';\n\nconst db = new BoxDB('my-database', 1);\n\n// Define your box (Object store)\nconst User = db.create('user', {\n  id: {\n    type: BoxDB.Types.NUMBER,\n    key: true, // This property is in-line-key\n  },\n  name: {\n    type: BoxDB.Types.STRING,\n    index: true, // This property is index\n  },\n  age: BoxDB.Types.NUMBER,\n});\n\nawait db.open();\n\n// Basics\nawait User.add({ id: 1, name: 'Tom', age: 10 });\nawait User.get(1);\nawait User.put({ id: 1, name: 'Tommy', age: 12 });\nawait User.delete(1);\n\n// find(range, ...filters) method using IDBCursor\n// Get records\nconst records = await User.find().get();\n\n// filter \u0026 sort \u0026 limit\nawait User.find(\n  null,\n  (user) =\u003e user.id % 2 !== 0,\n  (user) =\u003e user.age \u003e 10,\n  (user) =\u003e user.name.includes('y'),\n).get(BoxDB.Order.DESC, 10);\n\n// Update records (with filter)\nawait User\n  .find(null, (user) =\u003e user.age !== 0)\n  .update({ name: 'Timmy' });\n\n// Delete records (with IDBValidKey \u0026 IDBRange + IDBIndex)\nawait User\n  .find({\n    value: BoxDB.Range.equal('Timmy'),\n    index: 'name',\n  })\n  .delete();\n\n// Do multiple tasks in one transaction\nawait db.transaction(\n  User.$put({ id: 1, name: 'Tim', age: 20 }),\n  User.$add({ id: 2, name: 'Jessica', age: 15 }),\n  User.$add({ id: 3, name: 'Ellis', age: 13 }),\n  User\n    .$find({ value: 3 })\n    .put({ name: 'Tina' }),\n  BoxDB.interrupt(); // You can stop transaction like this!\n  User.$delete(2),\n  User\n    .$find(null, (user) =\u003e user.age \u003c 20)\n    .put({ name: 'Young' }),\n);\n\n// And other IndexedDB API features!\nawait User.count(); // Get all records count\nawait User.clear(); // Clear all records\n```\n\n## 📃 Table of Contents\n\n- [Features](#-features)\n- [Browsers Support](#-browsers-support)\n- [Installation](#-installation)\n- [Documentation](#-documentation)\n- [Example](#-example)\n- [Issue](#-issue)\n- [Development](#-development)\n- [Resources](#-resources)\n- [License](#-license)\n\n## 🌟 Features\n\n- Promise based ORM\n- User friendly and easy to use\n- Lightweight(\u003c 10kb) IndexedDB wrapper\n- Zero dependency\n- Database and object store version management\n- Data validation and transaction control via model (box)\n- ACID(Atomicity, Consistency, Isolation, Durability) guaranteed with transaction\n- Supports TypeScript\n- Works on [Web workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API)\n\n## 🌍 Browsers Support\n\n| \u003cimg src=\"https://user-images.githubusercontent.com/26512984/121935549-8292ca00-cd83-11eb-885c-9497bc78b104.png\" alt=\"Edge\" width=\"24px\" height=\"24px\" /\u003e\u003c/br\u003eIE | \u003cimg src=\"https://user-images.githubusercontent.com/26512984/121934559-64789a00-cd82-11eb-9238-4fc21eb835e2.png\" alt=\"Edge\" width=\"24px\" height=\"24px\" /\u003e\u003c/br\u003eEdge | \u003cimg src=\"https://user-images.githubusercontent.com/26512984/121934551-62aed680-cd82-11eb-8a33-593af8b5fdbd.png\" alt=\"Firefox\" width=\"24px\" height=\"24px\" /\u003e\u003c/br\u003eFirefox | \u003cimg src=\"https://user-images.githubusercontent.com/26512984/121934545-604c7c80-cd82-11eb-884d-d9d8dad26e01.png\" alt=\"Chrome\" width=\"24px\" height=\"24px\" /\u003e\u003c/br\u003eChrome | \u003cimg src=\"https://user-images.githubusercontent.com/26512984/121934539-5dea2280-cd82-11eb-96ed-fbef553ec0e6.png\" alt=\"Safari\" width=\"24px\" height=\"24px\" /\u003e\u003c/br\u003eSafari | \u003cimg src=\"https://user-images.githubusercontent.com/26512984/121934534-5c205f00-cd82-11eb-846b-cac169df47c7.png\" alt=\"iOS Safari\" width=\"24px\" height=\"24px\" /\u003e\u003c/br\u003eiOS Safari | \u003cimg src=\"https://user-images.githubusercontent.com/26512984/121934526-5aef3200-cd82-11eb-981d-835490f7b1b2.png\" alt=\"Samsung\" width=\"24px\" height=\"24px\" /\u003e\u003c/br\u003eSamsung | \u003cimg src=\"https://user-images.githubusercontent.com/26512984/121934519-59256e80-cd82-11eb-9b11-4805c7dd0ba1.png\" alt=\"Opera\" width=\"24px\" height=\"24px\" /\u003e\u003c/br\u003eOpera |\n| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| 11                                                                                                                                                               | 12~                                                                                                                                                                | 10~                                                                                                                                                                      | 23~                                                                                                                                                                    | 10~                                                                                                                                                                    | 10~                                                                                                                                                                            | 4~                                                                                                                                                                       | 15~                                                                                                                                                                  |\n\n- Test features in your browser [here](https://bxd.vercel.app/demo.html).\n- Checkout `IE11` test [here](https://bxd.vercel.app/ie).\n\n## 🛠 Installation\n\n```bash\nnpm install bxd\n```\n\nIn script tag:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/bxd@latest/dist/bxd.min.js\"\u003e\u003c/script\u003e\n```\n\nLooking for IE? Go to [this page](https://bxd.vercel.app/ie)\n\n## 📖 Documentation\n\nGo to documentation!\n\n- [EN](https://bxd.vercel.app) | [KR](https://bxd.vercel.app/kr) \n\n\n\n## 🌱 Example\n\n[Example](https://bxd.vercel.app/example)\n\n## 🔥 Issue\n\nOpening an issue or feature request [here](https://github.com/leegeunhyeok/bxd/issues)\n\n## 👨‍💻 Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Test\nnpm run test\n\n# Build\nnpm run build\n```\n\n## 🎨 Resources\n\n- Logo based on [Icon Fonts](http://www.onlinewebfonts.com/icon) (by CC BY 3.0)\n\n## 🍀 License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleegeunhyeok%2Fbxd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleegeunhyeok%2Fbxd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleegeunhyeok%2Fbxd/lists"}