Skip to content

Releases: toddy007/twin-db

2.*.*

Choose a tag to compare

@toddy007 toddy007 released this 16 Jul 02:01

07/15/2026 ( MM/DD/YYYY )

⚠️ Breaking Changes

  • New TwinDB constructor: now takes (path, options) instead of just a database name, allowing you to choose the storage backend (JSONStorage or SqliteStorage)
  • push and pull now accept values as an array (values: unknown[]) instead of rest parameters
  • Minimum required Node.js version bumped to >=22.13.0

✨ New Features

  • Full rewrite of TwinDB, moving from a single JSON-file-only implementation to a pluggable storage architecture
  • Storages
    • Added native SQLite support (node:sqlite) via the new SqliteStorage class, with configurable table and key
    • Added the JSONStorage class, decoupling JSON file storage logic from the core TwinDB logic
    • Added TwinMongoDB class, to store your data in your MongoDB.
  • Path-based get/set now use lodash instead of a manual split-loop
  • Added an in-memory cache to avoid repeated storage reads
  • All methods (get, set, delete, sum, sub, concat, push, pull) now accept an optional fetch parameter to force a re-read from storage before the operation
  • Added aliases: remove (for delete), add (for sum), and subtract (for sub)
  • Exported JSONStorage and SqliteStorage and TwinMongoDB for direct use

🐛 Fixes

  • Fixed the order of types/default fields in package.json's exports field for CJS/ESM builds

1.3.*

Choose a tag to compare

@toddy007 toddy007 released this 16 Jul 01:12

06/29/2026 ( MM/DD/YYYY )

Added support to require in commonjs.

1.2.*

Choose a tag to compare

@toddy007 toddy007 released this 16 Jul 01:11

05/03/2026 ( MM/DD/YYYY )

Now package doesn't uses eval anymore, providing better security.

1.1.*

Choose a tag to compare

@toddy007 toddy007 released this 16 Jul 01:05

04/09/2026 ( MM/DD/YYYY )

Now sum, sub and push sets the value to the value you passed in execution when the path does not exists.