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

@tauri-apps/plugin-fs

Package Overview
Dependencies
Maintainers
5
Versions
23
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-alpha.1 to 2.0.0-alpha.2

5

dist-js/index.d.ts

@@ -44,7 +44,2 @@ /**

import { BaseDirectory } from "@tauri-apps/api/path";
declare global {
interface Window {
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
}
}
interface Permissions {

@@ -51,0 +46,0 @@ /**

34

dist-js/index.min.js

@@ -1,6 +0,6 @@

var f$2=Object.defineProperty;var g$1=(a,b)=>{for(var c in b)f$2(a,c,{get:b[c],enumerable:!0});};var e=(a,b,c)=>{if(!b.has(a))throw TypeError("Cannot "+c)};var h$2=(a,b,c)=>(e(a,b,"read from private field"),c?c.call(a):b.get(a)),i$1=(a,b,c)=>{if(b.has(a))throw TypeError("Cannot add the same private member more than once");b instanceof WeakSet?b.add(a):b.set(a,c);},j$1=(a,b,c,d)=>(e(a,b,"write to private field"),d?d.call(a,c):b.set(a,c),c);
var f$1=Object.defineProperty;var g$1=(a,b)=>{for(var c in b)f$1(a,c,{get:b[c],enumerable:!0});};var e=(a,b,c)=>{if(!b.has(a))throw TypeError("Cannot "+c)};var h$1=(a,b,c)=>(e(a,b,"read from private field"),c?c.call(a):b.get(a)),i$1=(a,b,c)=>{if(b.has(a))throw TypeError("Cannot add the same private member more than once");b instanceof WeakSet?b.add(a):b.set(a,c);},j$1=(a,b,c,d)=>(e(a,b,"write to private field"),d?d.call(a,c):b.set(a,c),c);
var h$1={};g$1(h$1,{Channel:()=>o,PluginListener:()=>a$1,addPluginListener:()=>m$1,convertFileSrc:()=>y$1,invoke:()=>u$1,transformCallback:()=>s$1});function f$1(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s$1(n,e=!1){let t=f$1(),r=`_${t}`;return Object.defineProperty(window,r,{value:c=>(e&&Reflect.deleteProperty(window,r),n?.(c)),writable:!1,configurable:!0}),t}var i,o=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;i$1(this,i,()=>{});this.id=s$1(e=>{h$2(this,i).call(this,e);});}set onmessage(e){j$1(this,i,e);}get onmessage(){return h$2(this,i)}toJSON(){return `__CHANNEL__:${this.id}`}};i=new WeakMap;var a$1=class a{constructor(e,t,r){this.plugin=e,this.event=t,this.channelId=r;}async unregister(){return u$1(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function m$1(n,e,t){let r=new o;return r.onmessage=t,u$1(`plugin:${n}|register_listener`,{event:e,handler:r}).then(()=>new a$1(n,e,r.id))}async function u$1(n,e={},t){return new Promise((r,c)=>{let g=s$1(d=>{r(d),Reflect.deleteProperty(window,`_${_}`);},!0),_=s$1(d=>{c(d),Reflect.deleteProperty(window,`_${g}`);},!0);window.__TAURI_IPC__({cmd:n,callback:g,error:_,payload:e,options:t});})}function y$1(n,e="asset"){return window.__TAURI__.convertFileSrc(n,e)}
var T$1={};g$1(T$1,{Channel:()=>i,PluginListener:()=>o,addPluginListener:()=>l$1,convertFileSrc:()=>v$1,invoke:()=>u$1,transformCallback:()=>_$1});function _$1(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}var r,i=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;i$1(this,r,()=>{});this.id=_$1(n=>{h$1(this,r).call(this,n);});}set onmessage(n){j$1(this,r,n);}get onmessage(){return h$1(this,r)}toJSON(){return `__CHANNEL__:${this.id}`}};r=new WeakMap;var o=class{constructor(n,s,t){this.plugin=n,this.event=s,this.channelId=t;}async unregister(){return u$1(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function l$1(e,n,s){let t=new i;return t.onmessage=s,u$1(`plugin:${e}|register_listener`,{event:n,handler:t}).then(()=>new o(e,n,t.id))}async function u$1(e,n={},s){return window.__TAURI_INTERNALS__.invoke(e,n,s)}function v$1(e,n="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,n)}
var q={};g$1(q,{BaseDirectory:()=>t,appCacheDir:()=>p,appConfigDir:()=>s,appDataDir:()=>u,appLocalDataDir:()=>c,appLogDir:()=>x,audioDir:()=>a,basename:()=>U,cacheDir:()=>l,configDir:()=>g,dataDir:()=>d,delimiter:()=>j,desktopDir:()=>m,dirname:()=>H,documentDir:()=>y,downloadDir:()=>h,executableDir:()=>f,extname:()=>I,fontDir:()=>_,homeDir:()=>P,isAbsolute:()=>V,join:()=>F,localDataDir:()=>v,normalize:()=>E,pictureDir:()=>D,publicDir:()=>A,resolve:()=>z,resolveResource:()=>C,resourceDir:()=>b,runtimeDir:()=>L,sep:()=>k,tempDir:()=>T,templateDir:()=>R,videoDir:()=>w});var t=(r=>(r[r.Audio=1]="Audio",r[r.Cache=2]="Cache",r[r.Config=3]="Config",r[r.Data=4]="Data",r[r.LocalData=5]="LocalData",r[r.Document=6]="Document",r[r.Download=7]="Download",r[r.Picture=8]="Picture",r[r.Public=9]="Public",r[r.Video=10]="Video",r[r.Resource=11]="Resource",r[r.Temp=12]="Temp",r[r.AppConfig=13]="AppConfig",r[r.AppData=14]="AppData",r[r.AppLocalData=15]="AppLocalData",r[r.AppCache=16]="AppCache",r[r.AppLog=17]="AppLog",r[r.Desktop=18]="Desktop",r[r.Executable=19]="Executable",r[r.Font=20]="Font",r[r.Home=21]="Home",r[r.Runtime=22]="Runtime",r[r.Template=23]="Template",r))(t||{});async function s(){return u$1("plugin:path|resolve_directory",{directory:13})}async function u(){return u$1("plugin:path|resolve_directory",{directory:14})}async function c(){return u$1("plugin:path|resolve_directory",{directory:15})}async function p(){return u$1("plugin:path|resolve_directory",{directory:16})}async function a(){return u$1("plugin:path|resolve_directory",{directory:1})}async function l(){return u$1("plugin:path|resolve_directory",{directory:2})}async function g(){return u$1("plugin:path|resolve_directory",{directory:3})}async function d(){return u$1("plugin:path|resolve_directory",{directory:4})}async function m(){return u$1("plugin:path|resolve_directory",{directory:18})}async function y(){return u$1("plugin:path|resolve_directory",{directory:6})}async function h(){return u$1("plugin:path|resolve_directory",{directory:7})}async function f(){return u$1("plugin:path|resolve_directory",{directory:19})}async function _(){return u$1("plugin:path|resolve_directory",{directory:20})}async function P(){return u$1("plugin:path|resolve_directory",{directory:21})}async function v(){return u$1("plugin:path|resolve_directory",{directory:5})}async function D(){return u$1("plugin:path|resolve_directory",{directory:8})}async function A(){return u$1("plugin:path|resolve_directory",{directory:9})}async function b(){return u$1("plugin:path|resolve_directory",{directory:11})}async function C(i){return u$1("plugin:path|resolve_directory",{directory:11,path:i})}async function L(){return u$1("plugin:path|resolve_directory",{directory:22})}async function R(){return u$1("plugin:path|resolve_directory",{directory:23})}async function w(){return u$1("plugin:path|resolve_directory",{directory:10})}async function x(){return u$1("plugin:path|resolve_directory",{directory:17})}async function T(i){return u$1("plugin:path|resolve_directory",{directory:12})}function k(){return window.__TAURI__.path.__sep}function j(){return window.__TAURI__.path.__delimiter}async function z(...i){return u$1("plugin:path|resolve",{paths:i})}async function E(i){return u$1("plugin:path|normalize",{path:i})}async function F(...i){return u$1("plugin:path|join",{paths:i})}async function H(i){return u$1("plugin:path|dirname",{path:i})}async function I(i){return u$1("plugin:path|extname",{path:i})}async function U(i,e){return u$1("plugin:path|basename",{path:i,ext:e})}async function V(i){return u$1("plugin:path|isAbsolute",{path:i})}
var U={};g$1(U,{BaseDirectory:()=>t,appCacheDir:()=>p,appConfigDir:()=>s,appDataDir:()=>u,appLocalDataDir:()=>c,appLogDir:()=>w,audioDir:()=>a,basename:()=>H,cacheDir:()=>l,configDir:()=>g,dataDir:()=>d,delimiter:()=>E,desktopDir:()=>m,dirname:()=>z,documentDir:()=>y,downloadDir:()=>h,executableDir:()=>f,extname:()=>F,fontDir:()=>P,homeDir:()=>_,isAbsolute:()=>S,join:()=>j,localDataDir:()=>v,normalize:()=>N,pictureDir:()=>A,publicDir:()=>D,resolve:()=>I,resolveResource:()=>C,resourceDir:()=>b,runtimeDir:()=>L,sep:()=>k,tempDir:()=>x,templateDir:()=>R,videoDir:()=>T});var t=(r=>(r[r.Audio=1]="Audio",r[r.Cache=2]="Cache",r[r.Config=3]="Config",r[r.Data=4]="Data",r[r.LocalData=5]="LocalData",r[r.Document=6]="Document",r[r.Download=7]="Download",r[r.Picture=8]="Picture",r[r.Public=9]="Public",r[r.Video=10]="Video",r[r.Resource=11]="Resource",r[r.Temp=12]="Temp",r[r.AppConfig=13]="AppConfig",r[r.AppData=14]="AppData",r[r.AppLocalData=15]="AppLocalData",r[r.AppCache=16]="AppCache",r[r.AppLog=17]="AppLog",r[r.Desktop=18]="Desktop",r[r.Executable=19]="Executable",r[r.Font=20]="Font",r[r.Home=21]="Home",r[r.Runtime=22]="Runtime",r[r.Template=23]="Template",r))(t||{});async function s(){return u$1("plugin:path|resolve_directory",{directory:13})}async function u(){return u$1("plugin:path|resolve_directory",{directory:14})}async function c(){return u$1("plugin:path|resolve_directory",{directory:15})}async function p(){return u$1("plugin:path|resolve_directory",{directory:16})}async function a(){return u$1("plugin:path|resolve_directory",{directory:1})}async function l(){return u$1("plugin:path|resolve_directory",{directory:2})}async function g(){return u$1("plugin:path|resolve_directory",{directory:3})}async function d(){return u$1("plugin:path|resolve_directory",{directory:4})}async function m(){return u$1("plugin:path|resolve_directory",{directory:18})}async function y(){return u$1("plugin:path|resolve_directory",{directory:6})}async function h(){return u$1("plugin:path|resolve_directory",{directory:7})}async function f(){return u$1("plugin:path|resolve_directory",{directory:19})}async function P(){return u$1("plugin:path|resolve_directory",{directory:20})}async function _(){return u$1("plugin:path|resolve_directory",{directory:21})}async function v(){return u$1("plugin:path|resolve_directory",{directory:5})}async function A(){return u$1("plugin:path|resolve_directory",{directory:8})}async function D(){return u$1("plugin:path|resolve_directory",{directory:9})}async function b(){return u$1("plugin:path|resolve_directory",{directory:11})}async function C(i){return u$1("plugin:path|resolve_directory",{directory:11,path:i})}async function L(){return u$1("plugin:path|resolve_directory",{directory:22})}async function R(){return u$1("plugin:path|resolve_directory",{directory:23})}async function T(){return u$1("plugin:path|resolve_directory",{directory:10})}async function w(){return u$1("plugin:path|resolve_directory",{directory:17})}async function x(i){return u$1("plugin:path|resolve_directory",{directory:12})}function k(){return window.__TAURI_INTERNALS__.plugins.path.sep}function E(){return window.__TAURI_INTERNALS__.plugins.path.delimiter}async function I(...i){return u$1("plugin:path|resolve",{paths:i})}async function N(i){return u$1("plugin:path|normalize",{path:i})}async function j(...i){return u$1("plugin:path|join",{paths:i})}async function z(i){return u$1("plugin:path|dirname",{path:i})}async function F(i){return u$1("plugin:path|extname",{path:i})}async function H(i,e){return u$1("plugin:path|basename",{path:i,ext:e})}async function S(i){return u$1("plugin:path|isAbsolute",{path:i})}

@@ -64,3 +64,3 @@ // Copyright 2019-2023 Tauri Programme within The Commons Conservancy

async function readTextFile(filePath, options = {}) {
return await window.__TAURI_INVOKE__("plugin:fs|read_text_file", {
return await u$1("plugin:fs|read_text_file", {
path: filePath,

@@ -82,3 +82,3 @@ options,

async function readBinaryFile(filePath, options = {}) {
const arr = await window.__TAURI_INVOKE__("plugin:fs|read_file", {
const arr = await u$1("plugin:fs|read_file", {
path: filePath,

@@ -118,3 +118,3 @@ options,

}
return await window.__TAURI_INVOKE__("plugin:fs|write_file", {
return await u$1("plugin:fs|write_file", {
path: file.path,

@@ -155,3 +155,3 @@ contents: Array.from(new TextEncoder().encode(file.contents)),

}
return await window.__TAURI_INVOKE__("plugin:fs|write_file", {
return await u$1("plugin:fs|write_file", {
path: file.path,

@@ -185,3 +185,3 @@ contents: Array.from(file.contents instanceof ArrayBuffer

async function readDir(dir, options = {}) {
return await window.__TAURI_INVOKE__("plugin:fs|read_dir", {
return await u$1("plugin:fs|read_dir", {
path: dir,

@@ -207,3 +207,3 @@ options,

async function createDir(dir, options = {}) {
return await window.__TAURI_INVOKE__("plugin:fs|create_dir", {
return await u$1("plugin:fs|create_dir", {
path: dir,

@@ -228,3 +228,3 @@ options,

async function removeDir(dir, options = {}) {
return await window.__TAURI_INVOKE__("plugin:fs|remove_dir", {
return await u$1("plugin:fs|remove_dir", {
path: dir,

@@ -248,3 +248,3 @@ options,

async function copyFile(source, destination, options = {}) {
return await window.__TAURI_INVOKE__("plugin:fs|copy_file", {
return await u$1("plugin:fs|copy_file", {
source,

@@ -269,3 +269,3 @@ destination,

async function removeFile(file, options = {}) {
return await window.__TAURI_INVOKE__("plugin:fs|remove_file", {
return await u$1("plugin:fs|remove_file", {
path: file,

@@ -289,3 +289,3 @@ options,

async function renameFile(oldPath, newPath, options = {}) {
return await window.__TAURI_INVOKE__("plugin:fs|rename_file", {
return await u$1("plugin:fs|rename_file", {
oldPath,

@@ -308,3 +308,3 @@ newPath,

async function exists(path) {
return await window.__TAURI_INVOKE__("plugin:fs|exists", { path });
return await u$1("plugin:fs|exists", { path });
}

@@ -317,7 +317,5 @@ /**

async function metadata(path) {
return await window
.__TAURI_INVOKE__("plugin:fs|metadata", {
return await u$1("plugin:fs|metadata", {
path,
})
.then((metadata) => {
}).then((metadata) => {
const { accessedAtMs, createdAtMs, modifiedAtMs, ...data } = metadata;

@@ -324,0 +322,0 @@ return {

{
"name": "@tauri-apps/plugin-fs",
"version": "2.0.0-alpha.1",
"version": "2.0.0-alpha.2",
"description": "Access the file system.",

@@ -28,3 +28,3 @@ "license": "MIT or APACHE-2.0",

"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.6"
"@tauri-apps/api": "2.0.0-alpha.9"
},

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

@@ -7,3 +7,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.65**_
_This plugin requires a Rust version of at least **1.70**_

@@ -10,0 +10,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