New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

oplog-db

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oplog-db

A operations log on JS objects

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

oplog-db

This is a operations log reader/writer that forms the basis of simple JavaScript object persistence.

The idea is that your application has a number of JavaScript objects that you mutate over time in the form of "operations".

For object persistence, this package writes the operations to a local append-only file. On startup, the operations are parsed and replayed to recreate the same local database.

Appending to the log file is very fast, 10000 operations per second or so on an old Macbook Pro. Reading the oplog on startup is also fast but is dependent on the number and size of the operations.

You can always snapshot the data to a single JSON file but for larger amounts of data, this causes a large amount of memory to be used.

You are relegated to a single process for access or need some other form of locking should you need to access the log from multiple processes.

Your data must be JSON-encodable.

All objects are bucketed into collections. Each object must have a unique id within that collection.

Keywords

oplog

FAQs

Package last updated on 21 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts