New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@tauri-apps/plugin-fs

Package Overview
Dependencies
Maintainers
0
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tauri-apps/plugin-fs - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

34

dist-js/index.js

@@ -93,2 +93,15 @@ export { BaseDirectory } from '@tauri-apps/api/path';

}
// https://gist.github.com/zapthedingbat/38ebfbedd98396624e5b5f2ff462611d
/** Converts a big-endian eight byte array to number */
function fromBytes(buffer) {
const bytes = new Uint8ClampedArray(buffer);
const size = bytes.byteLength;
let x = 0;
for (let i = 0; i < size; i++) {
const byte = bytes[i];
x *= 0x100;
x += byte;
}
return x;
}
/**

@@ -135,7 +148,14 @@ * The Tauri abstraction for reading and writing files.

}
const [data, nread] = await invoke('plugin:fs|read', {
const data = await invoke('plugin:fs|read', {
rid: this.rid,
len: buffer.byteLength
});
buffer.set(data);
// Rust side will never return an empty array for this command and
// ensure there is at least 8 elements there.
//
// This is an optimization to include the number of read bytes (as bigendian bytes)
// at the end of returned array to avoid serialization overhead of separate values.
const nread = fromBytes(data.slice(-8));
const bytes = data instanceof ArrayBuffer ? new Uint8Array(data) : data;
buffer.set(bytes.slice(0, bytes.length - 8));
return nread === 0 ? null : nread;

@@ -621,6 +641,8 @@ }

}
await invoke('plugin:fs|write_text_file', {
path: path instanceof URL ? path.toString() : path,
data,
options
const encoder = new TextEncoder();
await invoke('plugin:fs|write_text_file', encoder.encode(data), {
headers: {
path: path instanceof URL ? path.toString() : path,
options: JSON.stringify(options)
}
});

@@ -627,0 +649,0 @@ }

2

package.json
{
"name": "@tauri-apps/plugin-fs",
"version": "2.0.0",
"version": "2.0.1",
"description": "Access the file system.",

@@ -5,0 +5,0 @@ "license": "MIT OR Apache-2.0",

@@ -15,3 +15,3 @@ ![plugin-fs](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/fs/banner.png)

_This plugin requires a Rust version of at least **1.78**_
_This plugin requires a Rust version of at least **1.77.2**_

@@ -18,0 +18,0 @@ There are three general methods of installation that we can recommend.

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