hyperdrive
Advanced tools
Comparing version 0.0.0-alpha to 1.0.1
{ | ||
"author": "Julien Biezemans <jb@jbpros.com>", | ||
"name": "hyperdrive", | ||
"version": "0.0.0-alpha", | ||
"description": "A REST framework", | ||
"main": "lib/main", | ||
"scripts": { | ||
"test": "echo \"No tests yet.\"" | ||
"version": "1.0.1", | ||
"description": "A file sharing network based on rabin file chunking and append only feeds of data verified by merkle trees.", | ||
"main": "index.js", | ||
"dependencies": { | ||
"bitfield": "^1.1.2", | ||
"buffer-equals": "^1.0.3", | ||
"bulk-write-stream": "^1.1.1", | ||
"debug": "^2.2.0", | ||
"duplexify": "^3.4.2", | ||
"flat-tree": "^1.2.1", | ||
"flush-write-stream": "^1.0.0", | ||
"last-one-wins": "^1.0.0", | ||
"length-prefixed-stream": "^1.4.0", | ||
"merkle-tree-stream": "^1.0.2", | ||
"numeric-id-map": "^1.1.0", | ||
"octal": "^1.0.0", | ||
"protocol-buffers": "^3.1.3", | ||
"pump": "^1.0.1", | ||
"pumpify": "^1.3.3", | ||
"rabin": "^1.4.0", | ||
"stream-collector": "^1.0.1", | ||
"sublevel-prefixer": "^1.0.0", | ||
"subleveldown": "^2.1.0", | ||
"through2": "^2.0.0", | ||
"thunky": "^0.1.0", | ||
"uint64be": "^1.0.1" | ||
}, | ||
"devDependencies": { | ||
"discovery-channel": "^1.2.0", | ||
"level": "^1.3.0", | ||
"memdb": "^1.0.1", | ||
"network-address": "^1.0.0" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/jbpros/hyperdrive.git" | ||
"url": "https://github.com/mafintosh/hyperdrive.git" | ||
}, | ||
"keywords": [ | ||
"rest", | ||
"hypermedia", | ||
"http", | ||
"web", | ||
"framework" | ||
], | ||
"dependencies": { | ||
"coffee-script": "1.3.3", | ||
"express-negotiate": "git://github.com/jbpros/express-negotiate.git#fix-header" | ||
"author": "Mathias Buus (@mafintosh)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/mafintosh/hyperdrive/issues" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "http://github.com/jbpros/hyperdrive/LICENSE" | ||
} | ||
], | ||
"license": "MIT" | ||
"homepage": "https://github.com/mafintosh/hyperdrive" | ||
} |
@@ -1,3 +0,96 @@ | ||
# Hyperdrive | ||
# hyperdrive | ||
A REST + Hypermedia framework for Node.js. | ||
A file sharing network based on [rabin](https://github.com/maxogden/rabin) file chunking and | ||
append only feeds of data verified by merkle trees. | ||
``` | ||
npm install hyperdrive | ||
``` | ||
# Status | ||
## Almost ready for prime time :rocket: | ||
## Feel free to open issues and ask questions | ||
APIs/protocols might be still break. | ||
Main things missing are: | ||
- [ ] Storing downloaded files as actual files (not in leveldb doh) | ||
- [ ] Full documention of the apis/protocols | ||
- [ ] Tit-for-tat swarm logic | ||
- [ ] Integrate peer discovery (currently has be handled externally) | ||
- [ ] Tests for internal logic | ||
- [ ] A bit of refactoring | ||
## Usage | ||
First create a new feed to share | ||
``` js | ||
var hyperdrive = require('hyperdrive') | ||
var fs = require('fs') | ||
var drive = hyperdrive(aLevelDB) | ||
var pack = drive.add() | ||
var stream = pack.entry({ | ||
name: 'my-file.txt', | ||
mode: 0644 | ||
}) | ||
fs.createReadStream('my-file.txt').pipe(stream) | ||
pack.finalize(function () { | ||
var link = pack.id.toString('hex') | ||
console.log(link, '<-- this is your hyperdrive link') | ||
}) | ||
``` | ||
Then to share it | ||
``` js | ||
var disc = require('discovery-channel')() | ||
var server = net.createServer(function (socket) { | ||
socket.pipe(drive.createPeerStream()).pipe(socket) | ||
}) | ||
server.listen(0, function () { | ||
function ann () { | ||
// discovery-channel currently only works with 20 bytes hashes | ||
disc.announce(link.slice(0, 20), server.address().port) | ||
} | ||
ann() | ||
setInterval(ann, 10000) | ||
var lookup = disc.lookup(hash.slice(0, 20)) | ||
lookup.on('peer', function (ip, port) { | ||
var socket = net.connect(port, ip) | ||
socket.pipe(drive.createPeerStream()).pipe(socket) | ||
}) | ||
}) | ||
``` | ||
If you run this code on multiple computers you should be able to access | ||
the content in the feed by doing | ||
``` js | ||
var feed = drive.get(link) // the link identifies/verifies the content | ||
feed.get(0, function (err, entry) { // get the first entry | ||
console.log(entry) // prints {name: 'my-file.txt', ...} | ||
var content = drive.get(entry.link) | ||
content.get(0, function (err, data) { | ||
console.log('first block of the file', data) | ||
content.get(1, ...) | ||
}) | ||
}) | ||
``` | ||
## License | ||
MIT |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
35838
2396
1045
0
0
97
0
22
4
13
5
0
+ Addedbitfield@^1.1.2
+ Addedbuffer-equals@^1.0.3
+ Addedbulk-write-stream@^1.1.1
+ Addeddebug@^2.2.0
+ Addedduplexify@^3.4.2
+ Addedflat-tree@^1.2.1
+ Addedflush-write-stream@^1.0.0
+ Addedlast-one-wins@^1.0.0
+ Addedmerkle-tree-stream@^1.0.2
+ Addednumeric-id-map@^1.1.0
+ Addedoctal@^1.0.0
+ Addedprotocol-buffers@^3.1.3
+ Addedpump@^1.0.1
+ Addedpumpify@^1.3.3
+ Addedrabin@^1.4.0
+ Addedstream-collector@^1.0.1
+ Addedsublevel-prefixer@^1.0.0
+ Addedsubleveldown@^2.1.0
+ Addedthrough2@^2.0.0
+ Addedthunky@^0.1.0
+ Addeduint64be@^1.0.1
+ Addedabstract-leveldown@2.6.32.7.2(transitive)
+ Addedacorn@7.4.1(transitive)
+ Addedansi-regex@2.1.1(transitive)
+ Addedaproba@1.2.0(transitive)
+ Addedare-we-there-yet@1.1.7(transitive)
+ Addedbindings@1.5.0(transitive)
+ Addedbitfield@1.1.2(transitive)
+ Addedbl@1.2.3(transitive)
+ Addedbrfs@1.6.1(transitive)
+ Addedbuffer-alloc@1.2.0(transitive)
+ Addedbuffer-alloc-unsafe@1.1.0(transitive)
+ Addedbuffer-equal@0.0.1(transitive)
+ Addedbuffer-equals@1.0.4(transitive)
+ Addedbuffer-fill@1.0.0(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedbulk-write-stream@1.1.4(transitive)
+ Addedchownr@1.1.4(transitive)
+ Addedcode-point-at@1.1.0(transitive)
+ Addedconcat-stream@1.6.2(transitive)
+ Addedconsole-control-strings@1.1.0(transitive)
+ Addedconvert-source-map@1.9.0(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddecompress-response@3.3.0(transitive)
+ Addeddeep-extend@0.6.0(transitive)
+ Addeddeep-is@0.1.4(transitive)
+ Addeddeferred-leveldown@1.2.2(transitive)
+ Addeddefined@0.0.0(transitive)
+ Addeddelegates@1.0.0(transitive)
+ Addeddetect-libc@1.0.3(transitive)
+ Addedduplexer2@0.1.4(transitive)
+ Addedduplexify@3.7.1(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addederrno@0.1.8(transitive)
+ Addedescodegen@1.9.12.1.0(transitive)
+ Addedesprima@3.1.34.0.1(transitive)
+ Addedestraverse@4.3.05.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedexpand-template@1.1.1(transitive)
+ Addedfalafel@2.2.5(transitive)
+ Addedfast-levenshtein@2.0.6(transitive)
+ Addedfile-uri-to-path@1.0.0(transitive)
+ Addedflat-tree@1.12.1(transitive)
+ Addedflush-write-stream@1.1.1(transitive)
+ Addedfs-constants@1.0.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedgauge@2.7.4(transitive)
+ Addedgenerate-function@2.3.1(transitive)
+ Addedgenerate-object-property@1.2.0(transitive)
+ Addedgithub-from-package@0.0.0(transitive)
+ Addedhas@1.0.4(transitive)
+ Addedhas-unicode@2.0.1(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedini@1.3.8(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedis-fullwidth-code-point@1.0.0(transitive)
+ Addedis-property@1.0.2(transitive)
+ Addedisarray@0.0.11.0.02.0.5(transitive)
+ Addedlast-one-wins@1.0.4(transitive)
+ Addedlength-prefixed-stream@1.6.0(transitive)
+ Addedlevel-codec@7.0.1(transitive)
+ Addedlevel-errors@1.0.5(transitive)
+ Addedlevel-iterator-stream@1.3.1(transitive)
+ Addedlevel-option-wrap@1.1.0(transitive)
+ Addedlevelup@1.3.9(transitive)
+ Addedlevn@0.3.0(transitive)
+ Addedmagic-string@0.22.5(transitive)
+ Addedmerge-source-map@1.0.4(transitive)
+ Addedmerkle-tree-stream@1.0.2(transitive)
+ Addedmimic-response@1.0.1(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedms@2.0.0(transitive)
+ Addednan@2.22.0(transitive)
+ Addednode-abi@2.30.1(transitive)
+ Addednoop-logger@0.1.1(transitive)
+ Addednpmlog@4.1.2(transitive)
+ Addednumber-is-nan@1.0.1(transitive)
+ Addednumeric-id-map@1.1.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedobject-inspect@1.4.1(transitive)
+ Addedoctal@1.0.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedoptionator@0.8.3(transitive)
+ Addedos-homedir@1.0.2(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedprebuild-install@2.5.3(transitive)
+ Addedprelude-ls@1.1.2(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedprotocol-buffers@3.2.1(transitive)
+ Addedprotocol-buffers-schema@3.6.0(transitive)
+ Addedprr@1.0.1(transitive)
+ Addedpump@1.0.32.0.1(transitive)
+ Addedpumpify@1.5.1(transitive)
+ Addedquote-stream@1.0.2(transitive)
+ Addedrabin@1.6.0(transitive)
+ Addedrc@1.2.8(transitive)
+ Addedreadable-stream@1.1.142.3.8(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedsafe-buffer@5.1.25.2.1(transitive)
+ Addedsemver@5.4.15.7.2(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedshallow-copy@0.0.1(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsigned-varint@2.0.1(transitive)
+ Addedsimple-concat@1.0.1(transitive)
+ Addedsimple-get@2.8.2(transitive)
+ Addedsource-map@0.5.70.6.1(transitive)
+ Addedstatic-eval@2.1.1(transitive)
+ Addedstatic-module@2.2.5(transitive)
+ Addedstream-collector@1.0.1(transitive)
+ Addedstream-shift@1.0.3(transitive)
+ Addedstring-width@1.0.2(transitive)
+ Addedstring_decoder@0.10.311.1.1(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedstrip-json-comments@2.0.1(transitive)
+ Addedsublevel-prefixer@1.0.0(transitive)
+ Addedsubleveldown@2.1.0(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedtar-fs@1.16.3(transitive)
+ Addedtar-stream@1.6.2(transitive)
+ Addedthrough2@2.0.5(transitive)
+ Addedthunky@0.1.0(transitive)
+ Addedto-buffer@1.1.1(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtype-check@0.3.2(transitive)
+ Addedtypedarray@0.0.6(transitive)
+ Addeduint64be@1.0.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedvarint@5.0.2(transitive)
+ Addedvlq@0.2.3(transitive)
+ Addedwhich-pm-runs@1.1.0(transitive)
+ Addedwide-align@1.1.5(transitive)
+ Addedword-wrap@1.2.5(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedxtend@4.0.2(transitive)
- Removedcoffee-script@1.3.3
- Removedexpress-negotiate@git://github.com/jbpros/express-negotiate.git#fix-header
- Removedcoffee-script@1.3.3(transitive)