🚀 Launch Week Day 5:Introducing Immutable Scans.Learn More →
Socket
Book a DemoInstallSign in
Socket

dat-graph

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dat-graph

Dat Merkle DAG

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
3
Created
Source

dat-graph

WORK IN PROGRESS

npm install dat-graph

build status

API

var dg = graph(levelup)

creates a new graph from a levelup

Range Options

Various methods use these options for specifying ranges in the graph:

since - array of nodes to begin the range until - array of nodes to end the range

dg.count(opts, cb)

Get the total number of nodes between a range. Calls cb with the node count for the range you specify

opts should be Range Options.

dg.match(hashes, cb)

Given an array of hashes, calls cb with the hashes that exist in the local graph

dg.heads(cb)

Calls cb with an array of the current heads of the graph

dg.createReadStream(opts)

Returns a readable stream that will emit graph nodes. opts should be Range Options

dg.createWriteStream()

Returns a writable stream that stores data in the graph

dg.get(key, cb)

Gets the value for a key in the graph, calls cb with the value

dg.append(value, cb)

Appends value to the current head, calls cb when done. Uses .add internally.

Inserts value into the graph as a child of links, calls cb when done.

dg.close(cb)

Calls close on the underlying dg.db

License

MIT

FAQs

Package last updated on 28 Oct 2015

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