Socket
Socket
Sign inDemoInstall

@node-wot/binding-file

Package Overview
Dependencies
22
Maintainers
5
Versions
39
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.8.11 to 0.8.12

11

dist/file-client.js

@@ -13,3 +13,3 @@ "use strict";

const core_1 = require("@node-wot/core");
const fs = require("fs");
const fs_1 = require("fs");
const node_url_1 = require("node:url");

@@ -28,4 +28,5 @@ const { debug } = (0, core_1.createLoggers)("binding-file", "file-client");

debug(`Reading file of Content-Type ${contentType} from path ${filePath}.`);
const resource = fs.createReadStream(filePath);
return new core_1.Content(contentType, resource);
const fileHandle = yield fs_1.promises.open(filePath);
const body = fileHandle.createReadStream();
return new core_1.Content(contentType, body);
});

@@ -46,5 +47,3 @@ }

const filePath = (0, node_url_1.fileURLToPath)(form.href);
const writeStream = fs.createWriteStream(filePath);
const buffer = yield content.toBuffer();
writeStream.end(buffer);
yield fs_1.promises.writeFile(filePath, content.body);
});

@@ -51,0 +50,0 @@ }

{
"name": "@node-wot/binding-file",
"version": "0.8.11",
"version": "0.8.12",
"description": "File client protocol binding for node-wot",

@@ -17,6 +17,6 @@ "author": "Eclipse Thingweb <thingweb-dev@eclipse.org> (https://thingweb.io/)",

"devDependencies": {
"@node-wot/td-tools": "0.8.11"
"@node-wot/td-tools": "0.8.12"
},
"dependencies": {
"@node-wot/core": "0.8.11"
"@node-wot/core": "0.8.12"
},

@@ -23,0 +23,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc