Socket
Socket
Sign inDemoInstall

@tauri-apps/api

Package Overview
Dependencies
Maintainers
5
Versions
79
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.4 to 1.5.5

10

CHANGELOG.md
# Changelog
## \[1.5.5]
### Enhancements
- [`7f885bd5e`](https://www.github.com/tauri-apps/tauri/commit/7f885bd5edf3e179ddf0b674c3ea7a96e26ce39e)([#9706](https://www.github.com/tauri-apps/tauri/pull/9706)) Enhance the speed of The JS `Command.execute` API from `shell` module.
### Bug Fixes
- [`7f885bd5e`](https://www.github.com/tauri-apps/tauri/commit/7f885bd5edf3e179ddf0b674c3ea7a96e26ce39e)([#9706](https://www.github.com/tauri-apps/tauri/pull/9706)) Fix The JS `Command.execute` API from `shell` module including extra new lines.
## \[1.5.4]

@@ -4,0 +14,0 @@

2

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

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

@@ -82,27 +82,2 @@ 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

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

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

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

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

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

async execute() {
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);
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
}
});

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

@@ -56,2 +56,15 @@ /**

* in `tauri.conf.json` and its access scope must be defined on the `assetScope` array on the same `protocol` object.
* For example:
* ```json
* {
* "tauri": {
* "allowlist": {
* "protocol": {
* "asset": true,
* "assetScope": ["$APPDATA/assets/*"]
* }
* }
* }
* }
* ```
*

@@ -58,0 +71,0 @@ * @param filePath The file path.

@@ -70,2 +70,15 @@ // Copyright 2019-2023 Tauri Programme within The Commons Conservancy

* in `tauri.conf.json` and its access scope must be defined on the `assetScope` array on the same `protocol` object.
* For example:
* ```json
* {
* "tauri": {
* "allowlist": {
* "protocol": {
* "asset": true,
* "assetScope": ["$APPDATA/assets/*"]
* }
* }
* }
* }
* ```
*

@@ -72,0 +85,0 @@ * @param filePath The file path.

Sorry, the diff of this file is not supported yet

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