Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

erebos-api-bzz-node

Package Overview
Dependencies
Maintainers
5
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

erebos-api-bzz-node - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

44

lib/index.js

@@ -10,2 +10,6 @@ 'use strict';

var _fs = require('fs');
var _fs2 = _interopRequireDefault(_fs);
var _erebosApiBzzBase = require('erebos-api-bzz-base');

@@ -25,2 +29,6 @@

var _tarFs = require('tar-fs');
var _tarFs2 = _interopRequireDefault(_tarFs);
var _tarStream = require('tar-stream');

@@ -99,2 +107,38 @@

uploadTarData(directory) {
const pack = _tarStream2.default.pack();
Object.keys(directory).forEach(function (key) {
pack.entry({ name: key }, directory[key].data);
});
pack.finalize();
return this._fetch(`${this._url}bzz:`, {
method: 'POST',
body: pack,
headers: {
'Content-Type': 'application/x-tar'
}
}).then(res => res.ok ? res.text() : Promise.reject(new Error(res.statusText)));
}
uploadTarFile(path) {
return this._fetch(`${this._url}bzz:`, {
method: 'POST',
body: _fs2.default.createReadStream(path),
headers: {
'Content-Type': 'application/x-tar'
}
}).then(res => res.ok ? res.text() : Promise.reject(new Error(res.statusText)));
}
uploadDirectoryTar(path) {
return this._fetch(`${this._url}bzz:`, {
method: 'POST',
body: _tarFs2.default.pack(path),
headers: {
'Content-Type': 'application/x-tar'
}
}).then(res => res.ok ? res.text() : Promise.reject(new Error(res.statusText)));
}
downloadDirectoryTar(hash) {

@@ -101,0 +145,0 @@ return this._fetch(`${this._url}bzz:/${hash}`, {

5

package.json
{
"name": "erebos-api-bzz-node",
"version": "0.3.3",
"version": "0.3.4",
"description": "Bzz API for node",

@@ -27,8 +27,9 @@ "repository": "git@github.com:MainframeHQ/erebos.git",

"node-fetch": "^2.2.0",
"tar-fs": "^1.16.3",
"tar-stream": "^1.6.1"
},
"devDependencies": {
"flow-bin": "^0.77.0",
"flow-bin": "^0.78.0",
"rxjs": "^6.2.2"
}
}
lib/index.js.flow

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc