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

simulated-multitree

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simulated-multitree

An in-memory simulated MultiTree for testing

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Simulated MultiTree

I created this to work on some applications while Multitree finishes getting written. It probably won't be useful to most people.

npm i simulated-multitree
import { SimulatedMultitree, SimulatedOplog, SimulatedRemoteOplog } from 'simulated-multitree'

// Create an multitree with a single writer
const db = new SimulatedMultitree()
db.addWriter(new SimulatedOplog())

// Create another multitree with its own writer
const db2 = new SimulatedMultitree()
db2.addWriter(new SimulatedOplog())

// Add them as writers to each other
db.addWriter(new SimulatedRemoteOplog(db2.writers[0]))
db2.addWriter(new SimulatedRemoteOplog(db.writers[0]))

// "Connect" them
db.writers[1].connect()
db2.writers[1].connect()

// "Disconnect" them
db.writers[1].disconnect()
db2.writers[1].disconnect()

// the rest of the API works like BitTree except there's also a `conflicts` array value on gets

FAQs

Package last updated on 15 Mar 2022

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