Skip to content
DatArchive implementation for browsers that uses dat-gateway
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.eslintrc Initial progress Apr 9, 2018
.gitignore Added bundle and docs Apr 11, 2018
DatArchive.js Reworked DatArchive using Dat-JS Apr 24, 2019
LICENSE Initial commit Apr 9, 2018
README.md Reworked DatArchive using Dat-JS Apr 24, 2019
browser.js Only add DatArchive global if it's not present Apr 24, 2019
example.html
index.js Reworked DatArchive using Dat-JS Apr 24, 2019
package.json Only add DatArchive global if it's not present Apr 24, 2019

README.md

dat-archive-web

DatArchive implementation for browsers using dat-js

npm install --save dat-archive-web

Or

<script src="//unpkg.com/dat-archive-web/bundle.js"></script>

Example

// After including the bundle in a script tag, or requiring it

const archive = new DatArchive('dat://87ed2e3b160f261a032af03921a3bd09227d0a4cde73466c17114816cae43336')

archive.readFile('/index.html')
  .then((html) => console.log(html))

API

Implements the same interface as DatArchive in Beaker with the following exceptions:

  • archive.diff(), archive.commit(), and archive.revert() are not supported
  • DatArchive.selectArchive() doesn't do filtering and looks crappy. Uses window.prompt API
  • DatArchive.resolveName() doesn't work and DNS based urls aren't supported. Waiting for dat-js support

Features

  • Support most DatArchive methods
  • Public bridges used to replicate with non-browser network
  • Detect HTTP/HTTPS in gateway URL
  • Data stored in memory by default, unless it was created locally.
  • [] Functional DatDNS support (via gateway)
  • Full support for versions (Needs testing, but code is there)
  • Forking (without preserving change feed)
  • DatArchive.selectArchive() Really rudimentary

Development

  • This project uses the standard code style
  • Run the example in node with npm install && npm run example
  • Build the browserify bundle with npm run build
You can’t perform that action at this time.