Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@seald-io/nedb

Package Overview
Dependencies
Maintainers
3
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@seald-io/nedb - npm Package Versions

1345

3.0.0

Diff

Changelog

Source

[3.0.0] - 2022-03-16

Added

  • Added a Promise-based interface.
  • The JSDoc is now much more exhaustive.
  • An auto-generated JSDoc file is generated: API.md.
  • Added Datastore#dropDatabaseAsync and its callback equivalent.
  • The Error given when the Datastore#corruptAlertThreshold is reached now has three properties: dataLength which is the amount of lines in the database file (excluding empty lines), corruptItems which is the amount of corrupted lines, corruptionRate which the rate of corruption between 0 and 1.
  • Added a modes: { fileMode, dirMode } option to the Datastore which allows to set the file and / or directory modes, by default, it uses 0o644 for files and 0o755 for directories, which may be breaking.

Changed

  • The corruptionAlertThreshold now doesn't take into account empty lines, and the error message is slightly changed.
  • The Datastore#update's callback has its signature slightly changed. The upsert flag is always defined either at true or false but not null nor undefined, and affectedDocuments is null when none is given rather than undefined (except when there is an error of course).
  • In order to expose a Promise-based interface and to remove async from the dependencies, many internals have been either rewritten or removed:
    • Datastore:
      • Datastore#getCandidates replaced with Datastore#_getCandidatesAsync;
      • Datastore#resetIndexes replaced with Datastore#_resetIndexes;
      • Datastore#addToIndexes replaced with Datastore#_addToIndexes;
      • Datastore#removeFromIndexes replaced with Datastore#_removeFromIndexes;
      • Datastore#updateIndexes replaced with Datastore#_updateIndexes;
      • Datastore#_insert replaced with Datastore#_insertAsync;
      • Datastore#_update replaced with Datastore#_updateAsync;
      • Datastore#_remove replaced with Datastore#_removeAsync;
    • Persistence:
      • Persistence#loadDatabase replaced with Persistence#loadDatabaseAsync;
      • Persistence#persistCachedDatabase replaced with Persistence#persistCachedDatabaseAsync;
      • Persistence#persistNewState replaced with Persistence#persistNewStateAsync;
      • Persistence#treatRawStream replaced with Persistence#treatRawStreamAsync;
      • Persistence.ensureDirectoryExists replaced with Persistence.ensureDirectoryExistsAsync;
    • Cursor:
      • Cursor#_exec replaced with Cursor#_execAsync;
      • Cursor#project replaced with Cursor#_project;
      • Cursor#execFn has been renamed to Cursor#mapFn and no longer supports a callback in its signature, it must be a synchronous function.
    • Executor: it has been rewritten entirely without the asynclibrary.
      • Executor#buffer & Executor#queue do not have the same signatures as before;
      • Executor#push replaced with Executor#pushAsync which is substantially different;
    • Storage modules : callback-based functions have been replaced with promise-based functions.
    • Model module: it has been slightly re-written for clarity, but no changes in its interface were made.
  • Typings were updated accordingly.

Deprecated

  • Using a string in the constructor of NeDB is now deprecated.
  • Using Datastore#persistence#compactDatafile is now deprecated, please use Datastore#compactDatafile instead.
  • Using Datastore#persistence#setAutocompactionInterval is now deprecated, please use Datastore#setAutocompactionInterval instead.
  • Using Datastore#persistence#stopAutocompaction is now deprecated, please use Datastore#stopAutocompaction instead.

Removed

  • The option for passing options.nodeWebkitAppName to the Datastore and the Persistence constructors has been removed, subsequently, the static method Persistence.getNWAppFilename has been removed as well;
  • Compatibility with node < 10.1.0 (we use fs.promises).

Fixed

  • [cherry picked from 2.2.2] #21 Typings for loadDatabase now support a callback.
seald
published 3.0.0-9 •

seald
published 3.0.0-8 •

seald
published 3.0.0-7 •

seald
published 2.2.2 •

Changelog

Source

[2.2.2] - 2022-03-10

Fixed

  • #21 Typings for loadDatabase now support a callback.
seald
published 2.2.2-0 •

seald
published 3.0.0-6 •

seald
published 3.0.0-5 •

seald
published 3.0.0-4 •

seald
published 3.0.0-3 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc