{"id":21156673,"url":"https://github.com/rxb3rth/lsdb","last_synced_at":"2025-07-09T12:32:38.331Z","repository":{"id":37086978,"uuid":"294455540","full_name":"roberthgnz/lsdb","owner":"roberthgnz","description":"Typed localStorage database powered by  with JSON definition","archived":false,"fork":false,"pushed_at":"2023-06-06T11:58:58.000Z","size":2376,"stargazers_count":15,"open_issues_count":9,"forks_count":9,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-11-10T11:40:27.612Z","etag":null,"topics":["database","hacktoberfest","localstorage","project"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@reliutg/lsdb","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/roberthgnz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-10T15:54:53.000Z","updated_at":"2023-12-08T03:24:49.000Z","dependencies_parsed_at":"2024-10-13T10:00:58.152Z","dependency_job_id":"4125bb42-0420-48f2-8f59-cd567902ca2e","html_url":"https://github.com/roberthgnz/lsdb","commit_stats":{"total_commits":471,"total_committers":22,"mean_commits":21.40909090909091,"dds":"0.42250530785562634","last_synced_commit":"f6a2aa36e90fe3e392d30e6cac4270904814b75b"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roberthgnz%2Flsdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roberthgnz%2Flsdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roberthgnz%2Flsdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roberthgnz%2Flsdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roberthgnz","download_url":"https://codeload.github.com/roberthgnz/lsdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225543531,"owners_count":17486059,"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":["database","hacktoberfest","localstorage","project"],"created_at":"2024-11-20T11:47:51.995Z","updated_at":"2025-07-09T12:32:33.003Z","avatar_url":"https://github.com/roberthgnz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lsdb\n\n[![CI](https://github.com/roberthgnz/lsdb/actions/workflows/main.yml/badge.svg)](https://github.com/roberthgnz/lsdb/actions/workflows/main.yml)\n[![Issues](https://img.shields.io/github/issues/roberthgnz/lsdb)](https://github.com/roberthgnz/lsdb/issues)\n[![Forks](https://img.shields.io/github/forks/roberthgnz/lsdb)](https://github.com/roberthgnz/lsdb)\n[![Stars](https://img.shields.io/github/stars/roberthgnz/lsdb)](https://github.com/roberthgnz/lsdb)\n[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg)](#contributors-)\n\nTyped localStorage database powered by  with JSON definition\n\n## Features\n\n- 📦 Tree-shakeable\n- ⚡ Fast\n- ✨ Lightweight\n- ❤️ Strongly typed\n\n## Installation\n\n```bash\nnpm i @reliutg/lsdb\n```\n\n## With Skypack\n\nno npm install needed!\n\n```html\n\u003cscript type=\"module\"\u003e\n  import Lsdb from 'https://cdn.skypack.dev/@reliutg/lsdb';\n\u003c/script\u003e\n```\n\n## We’ll start by setting up a database:\n\n```js\nconst lsdb = new Lsdb('dbname');\n```\n\n## Creating list of collections\n\n```js\n// Create multiple collections\nlsdb.collection(['categories', 'articles']);\n// Create single collection\nlsdb.collection('categories');\n```\n\n## Inserting\n\n```js\nlsdb.insert('categories', { title: 'Drinks' });\nlsdb.insert('categories', { title: 'Dinner' });\nlsdb.insert('categories', { title: 'Breakfast' });\nlsdb.insert('articles', { title: 'Coffee', category: 'Drinks' });\n```\n\n```js\nlsdb.insertMany('categories', [{ title: 'Drinks' }, { title: 'Dinner' }, { title: 'Breakfast' }]);\n```\n\n## Getting data\n\nGet single collection or all collection entries\n\n```js\nlsdb.all();\n// {categories: Array(2), articles: Array(0)}\n\nlsdb.all('categories');\n// [{title: 'Drinks'}, {title: 'Dinner'}, {title: 'Breakfast'}]\n```\n\nGet a list of documents\n\n```js\nlsdb.find('categories', {\n  where: {\n    category: { $in: ['Drinks'] },\n  },\n});\n\nlsdb.find('articles', {\n  where: {\n    category: { $eq: 'Drinks' },\n  },\n});\n\nlsdb.find('articles', {\n  sort: {\n    field: 'title',\n    order: 'asc'\n  },\n  limit: 2,\n  skip: 1,\n});\n```\n\n### Find Options\n\n| Field   | Type     | Description             | Default     | Required |\n| ------- | -------- | ----------------------- | ----------- | -------- |\n| `where` | `Object`   | Filter by object        | `undefined` | `false`  |\n| `sort`  | `Object` | Sort by field name      | `undefined` | `false`  |\n| `limit` | `number` | Limit number of results | `undefined` | `false`  |\n| `skip`  | `number` | Skip number of results  | `0`         | `false`  |\n\n### Available operators for where\n\nBased on [MongoDB](https://docs.mongodb.com/manual/reference/operator/query/#query-selectors) query selectors\n\n- `$eq` - Equal\n- `$in` - In\n- `$nin` - Not in\n- `$ne` - Not equal\n- `$gt` - Greater than\n- `$gte` - Greater than or equal\n- `$lt` - Less than\n- `$lte` - Less than or equal\n\nGet a single document matching the query\n\n```js\nlsdb.findOne('categories', {\n  where: {\n    _id: { $eq: id },\n  },\n});\n```\n\n## Updating\n\nUpdate a single document matching the query\n\n```js\nlsdb.update('categories', {\n  where: {\n    _id: { $eq: id },\n  },\n});\n```\n\n## Removing\n\nRemove a single document matching the query\n\n```js\nlsdb.delete('categories', {\n  where: {\n    _id: { $eq: id },\n  },\n});\n```\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/aneeshrelan\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/17068083?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAneesh Relan\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/roberthgnz/lsdb/commits?author=aneeshrelan\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"https://github.com/roberthgnz/lsdb/commits?author=aneeshrelan\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/fr0stylo\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/13507123?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eZymantas Maumevicius\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#infra-fr0stylo\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e \u003ca href=\"https://github.com/roberthgnz/lsdb/commits?author=fr0stylo\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/dekpient\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/717270?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eNitkalya Wiriyanuparb\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/roberthgnz/lsdb/commits?author=dekpient\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"https://github.com/roberthgnz/lsdb/commits?author=dekpient\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://connorruggles.dev\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/14317362?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eConnor Ruggles\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#infra-rugglcon\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e \u003ca href=\"https://github.com/roberthgnz/lsdb/commits?author=rugglcon\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://smakss.github.io/\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/32557358?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMAKSS\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/roberthgnz/lsdb/commits?author=SMAKSS\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://bit.ly/vvscodeli\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/6904368?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eVasiliy Vanchuk\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/roberthgnz/lsdb/commits?author=vvscode\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.linkedin.com/in/pablo-marcelo-bianco/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/358126?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ePablo\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/roberthgnz/lsdb/commits?author=marce1994\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frxb3rth%2Flsdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frxb3rth%2Flsdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frxb3rth%2Flsdb/lists"}