Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

dat-api

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dat-api

a javascript dat api

Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

dat-api

A pure JavaScript browser-friendly api for using dat.

Travis | NPM version

API

var dat = new Dat(opts)

dat.add(path, opts, onrepo)

Adds a new dat at the given path on the filesystem. Creates a .dat folder that manages the state of the dat.

  • path: the path on the filesystem to store data
  • The onrepo function will be called when the dat is finished being created.

Properties

dat.repos

Array of repo instances

Repo

The repo object managed by dat.

repo.key

The key of the repo

repo.privateKey

The private key of the repo. Used for granting write access.

repo.resume()

Joins the swarm for the repository, beginning to find peers in the network to share with.

repo.pause()

Pause syncing. This disconnects from any peers currently syncing data with the repo.

repo.swarm

Get to the original hyperdrive-archive-swarm instance, where the swarm can be managed.

repo.archive

Get to the original hyperdrive archive instance, where files can be managed using that api.

Events

dat.on('repo')

Fired every time a new repo is ready.

dat.on('close')

FAQs

Package last updated on 10 Nov 2016

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