2.0.4 • Published 7 years ago

hypershare v2.0.4

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

hypershare

Standard - JavaScript Style Guide Build Status npm version

Easily share files peer-to-peer with hyperdrive from code or command line.

CLI:

$ hypershare --file foo.txt,bar.txt
$ hypershare --link fb2a7568e70b281fd08baa13a574c256485f9f7

Code:

const Hypershare = require('hypershare')
const hs = new Hypershare()

// share a file
hs.share('foo.txt').then(link => {
  console.log(`Your hyperdrive link: ${link}`)
})

// download files
hs.download(link, 'downloads')
  .then(() => console.log('File downloaded!'))
  .catch(err => console.error(err))

install

$ npm i -g hypershare

usage

CLI

hypershare --file <files>

Takes a comma-separated list of file paths to share.

hypershare --link <hash>

Takes a hyperdrive link and downloads it to a downloads folder in the current working directory.

code

hs = new Hypershare([db])

Returns a new instance, where db is an optional level instance.

p = hs.share(files)

Takes a single file path (String) or an array of file paths and creates a hyperdrive archive from them and returns a promise that will give the archive's link, with what others can download the files.

p = hs.download(link, destination)

Downloads the archive specified by link and writes the files to destination. Returns a promise that runs after the download.

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago