Socket
Socket
Sign inDemoInstall

@tauri-apps/api

Package Overview
Dependencies
Maintainers
5
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tauri-apps/api - npm Package Compare versions

Comparing version 1.5.5 to 1.5.6

6

CHANGELOG.md
# Changelog
## \[1.5.6]
### Bug Fixes
- [`3b69c1384`](https://www.github.com/tauri-apps/tauri/commit/3b69c1384bd089ad5dcff0c1b12fbfadeb585c6a)([#9792](https://www.github.com/tauri-apps/tauri/pull/9792)) Revert [#9706](https://github.com/tauri-apps/tauri/pull/9706) which broke compatability between `tauri` crate and the JS `@tauri-apps/api` npm package in a patch release where it should've been in a minor release.
## \[1.5.5]

@@ -4,0 +10,0 @@

2

package.json
{
"name": "@tauri-apps/api",
"version": "1.5.5",
"version": "1.5.6",
"description": "Tauri API definitions",

@@ -5,0 +5,0 @@ "funding": {

@@ -82,2 +82,27 @@ import { invokeTauriCommand } from './helpers/tauri.js';

/**
* Spawns a process.
*
* @ignore
* @param program The name of the scoped command.
* @param onEvent Event handler.
* @param args Program arguments.
* @param options Configuration for the process spawn.
* @returns A promise resolving to the process id.
*/
async function execute(onEvent, program, args = [], options) {
if (typeof args === 'object') {
Object.freeze(args);
}
return invokeTauriCommand({
__tauriModule: 'Shell',
message: {
cmd: 'execute',
program,
args,
options,
onEventFn: transformCallback(onEvent)
}
});
}
/**
* @since 1.0.0

@@ -353,9 +378,3 @@ */

async spawn() {
const program = this.program;
const args = this.args;
const options = this.options;
if (typeof args === 'object') {
Object.freeze(args);
}
const onEvent = (event) => {
return execute((event) => {
switch (event.event) {

@@ -375,13 +394,3 @@ case 'Error':

}
};
return invokeTauriCommand({
__tauriModule: 'Shell',
message: {
cmd: 'execute',
program,
args,
options,
onEventFn: transformCallback(onEvent)
}
}).then((pid) => new Child(pid));
}, this.program, this.args, this.options).then((pid) => new Child(pid));
}

@@ -403,16 +412,21 @@ /**

async execute() {
const program = this.program;
const args = this.args;
const options = this.options;
if (typeof args === 'object') {
Object.freeze(args);
}
return invokeTauriCommand({
__tauriModule: 'Shell',
message: {
cmd: 'executeAndReturn',
program,
args,
options
}
return new Promise((resolve, reject) => {
this.on('error', reject);
const stdout = [];
const stderr = [];
this.stdout.on('data', (line) => {
stdout.push(line);
});
this.stderr.on('data', (line) => {
stderr.push(line);
});
this.on('close', (payload) => {
resolve({
code: payload.code,
signal: payload.signal,
stdout: stdout.join('\n'),
stderr: stderr.join('\n')
});
});
this.spawn().catch(reject);
});

@@ -419,0 +433,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc