Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joehand/url-dat
Put files from urls into dat
https://github.com/joehand/url-dat
Last synced: 30 days ago
JSON representation
Put files from urls into dat
- Host: GitHub
- URL: https://github.com/joehand/url-dat
- Owner: joehand
- Created: 2016-07-14T02:05:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-01T20:09:58.000Z (about 8 years ago)
- Last Synced: 2024-12-24T23:08:48.266Z (about 1 month ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 5
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
- awesome-dat - url-dat - import files from http url's into a hyperdrive archive, uses `tar-dat` (Outdated / Other Related Dat Project Modules)
README
# Urls to Dat
Put files from urls into a hyperdrive archive
See other modules for more info:
* [tar-dat](https://github.com/joehand/tar-dat): streams tarball into dat
* [url-tar](https://github.com/joehand/url-tar): puts body from url into tar## Usage
`urlDat(urls, archive, cb)`
```javascript
var hyperdrive = require('hyperdrive')
var swarm = require('hyperdrive-archive-swarm')
var memdb = require('memdb')
var urlDat = require('url-dat')var drive = hyperdrive(memdb())
var archive = drive.createArchive()var urls = ['http://google.com', 'http://npmjs.com']
urlDat(urls, archive, function (err) {
if (err) throw err
archive.finalize(function (err) {
if (err) throw err
console.log('sharing key: ', archive.key.toString('hex'))
swarm(archive)
})
})
```