RepositoryTypeScriptCNTrung Quốc
chenstarx

chenstarx/GoDB.js

IndexedDB with Intuitive API,轻松搞定浏览器数据库🎉

173sao
20fork
3issue
0lượt xem

🛠️ GoDB.js: IndexedDB dễ dùng như localStorage

CRUD chỉ bằng một dòng lệnh, tìm kiếm linh hoạt như Array.find()

GoDB.js là một thư viện TypeScript nhẹ giúp bạn làm việc với IndexedDB trong trình duyệt một cách trực quan và đơn giản. Thay vì phải viết mã rắt rối với API gốc của IndexedDB, GoDB.js cung cấp API thân thiện cho phép thực hiện các thao tác CRUD (tạo, đọc, cập nhật, xóa) chỉ trong một dòng lệnh.

✨ Điểm nổi bật

  • CRUD một dòng lệnh: Thực hiện thao tác thêm, lấy, cập nhật, xóa dữ liệu chỉ bằng một câu lệnh duy nhất.
  • Hỗ trợ thêm nhiều bản ghi: Phương thức addMany() cho phép thêm hàng loạt dữ liệu cùng lúc.
  • Tìm kiếm linh hoạt: Cung cấp Table.find() và Table.findAll() để tìm kiếm dựa trên hàm tùy chỉnh, tương tự Array.find().
  • Định nghĩa schema: Hỗ trợ định nghĩa cấu trúc bảng với kiểu dữ liệu và ràng buộc duy nhất, lấy cảm hứng từ Mongoose.
  • Tự động nâng cấp phiên bản: Tự động tạo objectStore mới khi mở bảng sau khi cơ sở dữ liệu đã được mở.
  • Hiển thị dữ liệu trên console: Phương thức consoleTable() giúp in ra bảng dữ liệu dưới dạng bảng trên console.

💡 Vì sao đáng chú ý

GoDB.js giải quyết vấn đề phức tạp và khó sử dụng của IndexedDB bằng cách cung cấp một lớp bao bọc (wrapper) với API trực quan. Điều này giúp các nhà phát triển không cần phải học và thành thạo IndexedDB mà vẫn có thể lưu trữ và quản lý dữ liệu phong phú trên trình duyện. Dự án đặc biệt hữu ích cho các ứng dụng web cần lưu trữ dữ liệu cục bộ mà không muốn dựa vào localStorage hay sessionStorage.


#IndexedDB #TypeScript #OpenSource #GoDB #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositoryTypeScript
cyrilletuzi/angular-async-local-storage

Efficient client-side storage for Angular: simple API + performance + Observables + validation

676
Nov 23, 2026
RepositoryTypeScript
n8n-io/n8n

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

212.9k
Dec 2, 2026
RepositoryTypeScript
microsoft/vscode

Visual Studio Code

195.9k
Nov 30, 2026
RepositoryJavaScript
localForage/localForage

💾 Offline storage, improved. Wraps IndexedDB, WebSQL, or localStorage using a simple but powerful API.

25.8k
Jul 30, 2024
RepositoryJavaScript
remotestorage/remotestorage.js

⬡ JavaScript client library for integrating remoteStorage in apps

2.4k
Nov 29, 2026
RepositoryJavaScript
pubkey/broadcast-channel

:satellite: BroadcastChannel to send data between different browser-tabs or nodejs-processes :satellite: + LeaderElection over the channels https://pubkey.github.io/broadcast-channel/

2.0k
Nov 28, 2026
RepositoryJavaScript
babycommando/entity-db

EntityDB is an in-browser vector database wrapping indexedDB and Transformers.js over WebAssembly

296
May 8, 2025
RepositoryTypeScript
twentyhq/twenty

The open alternative to Salesforce, designed for AI.

61.7k
Nov 30, 2026
RepositoryTypeScript
chenglou/pretext

Fast, accurate & comprehensive text measurement & layout

51.1k
Nov 25, 2026