diff --git a/plugins/app/README.md b/plugins/app/README.md index 640c63dc..34d44e56 100644 --- a/plugins/app/README.md +++ b/plugins/app/README.md @@ -1,4 +1,4 @@ -![plugin-app](https://github.com/tauri-apps/plugins-workspace/blob/0417b7ad6047694cf101592ed65b41dc006df5ea/plugins/app/banner.png) +![plugin-app](banner.png) This plugin provides APIs to read application metadata and macOS app visibility functions. @@ -60,7 +60,7 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { getVersion, hide } from '@tauri-apps/plugin-app'; +import { getVersion, hide } from "@tauri-apps/plugin-app"; const appVersion = await getVersion(); await hide(); ``` diff --git a/plugins/authenticator/README.md b/plugins/authenticator/README.md index 8a239515..29819697 100644 --- a/plugins/authenticator/README.md +++ b/plugins/authenticator/README.md @@ -1,4 +1,4 @@ -![plugin-authenticator](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/authenticator/banner.png) +![plugin-authenticator](banner.png) Use hardware security-keys in your Tauri App. @@ -70,7 +70,7 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { Authenticator } from '@tauri-apps/plugin-authenticator'; +import { Authenticator } from "@tauri-apps/plugin-authenticator"; const auth = new Authenticator(); auth.init(); // initialize transports @@ -80,9 +80,9 @@ const arr = new Uint32Array(32); window.crypto.getRandomValues(arr); const b64 = btoa(String.fromCharCode.apply(null, arr)); // web-safe base64 -const challenge = b64.replace(/\+/g, '-').replace(/\//g, '_'); +const challenge = b64.replace(/\+/g, "-").replace(/\//g, "_"); -const domain = 'https://tauri.app'; +const domain = "https://tauri.app"; // attempt to register with the security key const json = await auth.register(challenge, domain); @@ -93,7 +93,7 @@ const r2 = await auth.verifyRegistration( challenge, app, registerResult.registerData, - registerResult.clientData + registerResult.clientData, ); const j2 = JSON.parse(r2); @@ -108,11 +108,11 @@ const counter = await auth.verifySignature( signData.signData, clientData, keyHandle, - pubkey + pubkey, ); if (counter && counter > 0) { - console.log('SUCCESS!'); + console.log("SUCCESS!"); } ``` diff --git a/plugins/autostart/README.md b/plugins/autostart/README.md index 0c42785c..f14fd2c2 100644 --- a/plugins/autostart/README.md +++ b/plugins/autostart/README.md @@ -1,4 +1,4 @@ -![plugin-autostart](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/autostart/banner.png) +![plugin-autostart](banner.png) Automatically launch your application at startup. Supports Windows, Mac (via AppleScript or Launch Agent), and Linux. @@ -62,7 +62,7 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { enable, isEnabled, disable } from '@tauri-apps/plugin-autostart'; +import { enable, isEnabled, disable } from "@tauri-apps/plugin-autostart"; await enable(); diff --git a/plugins/cli/README.md b/plugins/cli/README.md index ee54101e..c0bd1ae4 100644 --- a/plugins/cli/README.md +++ b/plugins/cli/README.md @@ -1,4 +1,4 @@ -![plugin-cli](https://github.com/tauri-apps/plugins-workspace/blob/0417b7ad6047694cf101592ed65b41dc006df5ea/plugins/cli/banner.png) +![plugin-cli](banner.png) Parse arguments from your Command Line Interface. @@ -67,12 +67,12 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { getMatches } from '@tauri-apps/plugin-cli'; +import { getMatches } from "@tauri-apps/plugin-cli"; const matches = await getMatches(); -if (matches.subcommand?.name === 'run') { +if (matches.subcommand?.name === "run") { // `./your-app run $ARGS` was executed const args = matches.subcommand?.matches.args; - if ('debug' in args) { + if ("debug" in args) { // `./your-app run --debug` was executed } } else { diff --git a/plugins/clipboard-manager/README.md b/plugins/clipboard-manager/README.md index d8f4411a..3bdc6f73 100644 --- a/plugins/clipboard-manager/README.md +++ b/plugins/clipboard-manager/README.md @@ -1,4 +1,4 @@ -![plugin-clipboard-manager](https://github.com/tauri-apps/plugins-workspace/blob/0417b7ad6047694cf101592ed65b41dc006df5ea/plugins/clipboard-manager/banner.png) +![plugin-clipboard-manager](banner.png) Read and write to the system clipboard. @@ -60,9 +60,9 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { writeText, readText } from '@tauri-apps/plugin-clipboard-manager'; -await writeText('Tauri is awesome!'); -assert(await readText(), 'Tauri is awesome!'); +import { writeText, readText } from "@tauri-apps/plugin-clipboard-manager"; +await writeText("Tauri is awesome!"); +assert(await readText(), "Tauri is awesome!"); ``` ## Contributing diff --git a/plugins/dialog/README.md b/plugins/dialog/README.md index f258f66d..2c5638fc 100644 --- a/plugins/dialog/README.md +++ b/plugins/dialog/README.md @@ -1,4 +1,4 @@ -![plugin-dialog](https://github.com/tauri-apps/plugins-workspace/blob/0417b7ad6047694cf101592ed65b41dc006df5ea/plugins/dialog/banner.png) +![plugin-dialog](banner.png) Native system dialogs for opening and saving files along with message dialogs. diff --git a/plugins/fs/README.md b/plugins/fs/README.md index b5a03887..24501a34 100644 --- a/plugins/fs/README.md +++ b/plugins/fs/README.md @@ -1,4 +1,4 @@ -![plugin-fs](https://github.com/tauri-apps/plugins-workspace/blob/0417b7ad6047694cf101592ed65b41dc006df5ea/plugins/fs/banner.png) +![plugin-fs](banner.png) Access the file system. @@ -60,9 +60,9 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { metadata } from '@tauri-apps/plugin-fs'; +import { metadata } from "@tauri-apps/plugin-fs"; -await metadata('/path/to/file'); +await metadata("/path/to/file"); ``` ## Contributing diff --git a/plugins/global-shortcut/README.md b/plugins/global-shortcut/README.md index 99cff290..7c5097ce 100644 --- a/plugins/global-shortcut/README.md +++ b/plugins/global-shortcut/README.md @@ -1,4 +1,4 @@ -![plugin-global-shortcut](https://github.com/tauri-apps/plugins-workspace/blob/0417b7ad6047694cf101592ed65b41dc006df5ea/plugins/global-shortcut/banner.png) +![plugin-global-shortcut](banner.png) Register global shortcuts. diff --git a/plugins/http/README.md b/plugins/http/README.md index c8f806b8..54532243 100644 --- a/plugins/http/README.md +++ b/plugins/http/README.md @@ -1,4 +1,4 @@ -![plugin-http](https://github.com/tauri-apps/plugins-workspace/blob/0417b7ad6047694cf101592ed65b41dc006df5ea/plugins/http/banner.png) +![plugin-http](banner.png) Access the HTTP client written in Rust. @@ -60,9 +60,9 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { fetch } from '@tauri-apps/plugin-http'; -const response = await fetch('http://localhost:3003/users/2', { - method: 'GET', +import { fetch } from "@tauri-apps/plugin-http"; +const response = await fetch("http://localhost:3003/users/2", { + method: "GET", timeout: 30, }); ``` diff --git a/plugins/localhost/README.md b/plugins/localhost/README.md index d4f92c70..5b83bf4b 100644 --- a/plugins/localhost/README.md +++ b/plugins/localhost/README.md @@ -1,4 +1,4 @@ -![plugin-localhost](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/localhost/banner.png) +![plugin-localhost](banner.png) Expose your apps assets through a localhost server instead of the default custom protocol. diff --git a/plugins/log/README.md b/plugins/log/README.md index 14390955..50aaecbf 100644 --- a/plugins/log/README.md +++ b/plugins/log/README.md @@ -1,4 +1,4 @@ -![plugin-log](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/log/banner.png) +![plugin-log](banner.png) Configurable logging for your Tauri app. @@ -66,14 +66,14 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { trace, info, error, attachConsole } from '@tauri-apps/plugin-log'; +import { trace, info, error, attachConsole } from "@tauri-apps/plugin-log"; // with LogTarget::Webview enabled this function will print logs to the browser console const detach = await attachConsole(); -trace('Trace'); -info('Info'); -error('Error'); +trace("Trace"); +info("Info"); +error("Error"); // detach the browser console from the log stream detach(); diff --git a/plugins/notification/README.md b/plugins/notification/README.md index 277feb88..95ca72b3 100644 --- a/plugins/notification/README.md +++ b/plugins/notification/README.md @@ -1,4 +1,4 @@ -![plugin-notification](https://github.com/tauri-apps/plugins-workspace/blob/0417b7ad6047694cf101592ed65b41dc006df5ea/plugins/notification/banner.png) +![plugin-notification](banner.png) Send message notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API. diff --git a/plugins/os/README.md b/plugins/os/README.md index 55e40fca..f7ce7954 100644 --- a/plugins/os/README.md +++ b/plugins/os/README.md @@ -1,4 +1,4 @@ -![plugin-os](https://github.com/tauri-apps/plugins-workspace/blob/0417b7ad6047694cf101592ed65b41dc006df5ea/plugins/os/banner.png) +![plugin-os](banner.png) Read information about the operating system. @@ -60,7 +60,7 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { version } from '@tauri-apps/plugin-os'; +import { version } from "@tauri-apps/plugin-os"; const osVersion = await version(); ``` diff --git a/plugins/persisted-scope/README.md b/plugins/persisted-scope/README.md index 6e271330..1a7e19bf 100644 --- a/plugins/persisted-scope/README.md +++ b/plugins/persisted-scope/README.md @@ -1,4 +1,4 @@ -![plugin-persisted-scope](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/persisted-scope/banner.png) +![plugin-persisted-scope](banner.png) Save filesystem and asset scopes and restore them when the app is reopened. diff --git a/plugins/positioner/README.md b/plugins/positioner/README.md index 1f06dbb7..e80eb516 100644 --- a/plugins/positioner/README.md +++ b/plugins/positioner/README.md @@ -1,4 +1,4 @@ -![plugin-positioner](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/positioner/banner.png) +![plugin-positioner](banner.png) Position your windows at well-known locations. @@ -66,7 +66,7 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { move_window, Position } from '@tauri-apps/plugin-positioner'; +import { move_window, Position } from "@tauri-apps/plugin-positioner"; move_window(Position.TopRight); ``` diff --git a/plugins/process/README.md b/plugins/process/README.md index d3a190f3..10b0a111 100644 --- a/plugins/process/README.md +++ b/plugins/process/README.md @@ -1,4 +1,4 @@ -![plugin-process](https://github.com/tauri-apps/plugins-workspace/blob/0417b7ad6047694cf101592ed65b41dc006df5ea/plugins/process/banner.png) +![plugin-process](banner.png) This plugin provides APIs to access the current process. To spawn child processes, see the [`shell`](https://github.com/tauri-apps/tauri-plugin-shell) plugin. @@ -60,7 +60,7 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { exit, relaunch } from '@tauri-apps/plugin-process'; +import { exit, relaunch } from "@tauri-apps/plugin-process"; // exit the app with the given status code await exit(0); // restart the app diff --git a/plugins/shell/README.md b/plugins/shell/README.md index 2e90fd28..8389a687 100644 --- a/plugins/shell/README.md +++ b/plugins/shell/README.md @@ -1,4 +1,4 @@ -![plugin-shell](https://github.com/tauri-apps/plugins-workspace/blob/0417b7ad6047694cf101592ed65b41dc006df5ea/plugins/shell/banner.png) +![plugin-shell](banner.png) Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application. @@ -60,8 +60,8 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { Command } from '@tauri-apps/plugin-shell'; -Command.create('git', ['commit', '-m', 'the commit message']); +import { Command } from "@tauri-apps/plugin-shell"; +Command.create("git", ["commit", "-m", "the commit message"]); ``` ## Contributing diff --git a/plugins/single-instance/README.md b/plugins/single-instance/README.md index 0e3152fc..2cb2d88e 100644 --- a/plugins/single-instance/README.md +++ b/plugins/single-instance/README.md @@ -1,4 +1,4 @@ -![tauri-plugin-single-instance](https://github.com/tauri-apps/plugins-workspace/blob/96fc592649ccf64613afff0bf523dcd3c230f6ad/plugins/single-instance/banner.png) +![tauri-plugin-single-instance](banner.png) Ensure a single instance of your tauri app is running. diff --git a/plugins/sql/README.md b/plugins/sql/README.md index 5c2c4bb7..e0f68fbb 100644 --- a/plugins/sql/README.md +++ b/plugins/sql/README.md @@ -1,4 +1,4 @@ -![plugin-sql](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/sql/banner.png) +![plugin-sql](banner.png) Interface with SQL databases through [sqlx](https://github.com/launchbadge/sqlx). It supports the `sqlite`, `mysql` and `postgres` drivers, enabled by a Cargo feature. @@ -62,16 +62,16 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import Database from '@tauri-apps/plugin-sql'; +import Database from "@tauri-apps/plugin-sql"; // sqlite. The path is relative to `tauri::api::path::BaseDirectory::App`. -const db = await Database.load('sqlite:test.db'); +const db = await Database.load("sqlite:test.db"); // mysql -const db = await Database.load('mysql://user:pass@host/database'); +const db = await Database.load("mysql://user:pass@host/database"); // postgres -const db = await Database.load('postgres://postgres:password@localhost/test'); +const db = await Database.load("postgres://postgres:password@localhost/test"); -await db.execute('INSERT INTO ...'); +await db.execute("INSERT INTO ..."); ``` ## Syntax @@ -84,24 +84,24 @@ We use sqlx as our underlying library, adopting their query syntax: ```javascript // INSERT and UPDATE examples for sqlite and postgres const result = await db.execute( - 'INSERT into todos (id, title, status) VALUES ($1, $2, $3)', - [todos.id, todos.title, todos.status] + "INSERT into todos (id, title, status) VALUES ($1, $2, $3)", + [todos.id, todos.title, todos.status], ); const result = await db.execute( - 'UPDATE todos SET title = $1, completed = $2 WHERE id = $3', - [todos.title, todos.status, todos.id] + "UPDATE todos SET title = $1, completed = $2 WHERE id = $3", + [todos.title, todos.status, todos.id], ); // INSERT and UPDATE examples for mysql const result = await db.execute( - 'INSERT into todos (id, title, status) VALUES (?, ?, ?)', - [todos.id, todos.title, todos.status] + "INSERT into todos (id, title, status) VALUES (?, ?, ?)", + [todos.id, todos.title, todos.status], ); const result = await db.execute( - 'UPDATE todos SET title = ?, completed = ? WHERE id = ?', - [todos.title, todos.status, todos.id] + "UPDATE todos SET title = ?, completed = ? WHERE id = ?", + [todos.title, todos.status, todos.id], ); ``` diff --git a/plugins/store/README.md b/plugins/store/README.md index b00ab4cc..90b0b7ef 100644 --- a/plugins/store/README.md +++ b/plugins/store/README.md @@ -1,4 +1,4 @@ -![plugin-store](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/store/banner.png) +![plugin-store](banner.png) Simple, persistent key-value store. @@ -60,13 +60,13 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { Store } from '@tauri-apps/plugin-store'; +import { Store } from "@tauri-apps/plugin-store"; -const store = new Store('.settings.dat'); +const store = new Store(".settings.dat"); -await store.set('some-key', { value: 5 }); +await store.set("some-key", { value: 5 }); -const val = await store.get('some-key'); +const val = await store.get("some-key"); assert(val, { value: 5 }); await store.save(); // this manually saves the store, otherwise the store is only saved when your app is closed diff --git a/plugins/stronghold/README.md b/plugins/stronghold/README.md index 85aaef93..7254b857 100644 --- a/plugins/stronghold/README.md +++ b/plugins/stronghold/README.md @@ -1,4 +1,4 @@ -![plugin-stronghold](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/stronghold/banner.png) +![plugin-stronghold](banner.png) Store secrets and keys using the [IOTA Stronghold](https://github.com/iotaledger/stronghold.rs) encrypted database and secure runtime. @@ -64,7 +64,7 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { Stronghold, Location } from '@tauri-apps/plugin-stronghold'; +import { Stronghold, Location } from "@tauri-apps/plugin-stronghold"; // TODO ``` diff --git a/plugins/updater/README.md b/plugins/updater/README.md index bd9229bf..0e47281f 100644 --- a/plugins/updater/README.md +++ b/plugins/updater/README.md @@ -1,4 +1,4 @@ -![plugin-updater](https://github.com/tauri-apps/plugins-workspace/blob/0417b7ad6047694cf101592ed65b41dc006df5ea/plugins/updater/banner.png) +![plugin-updater](banner.png) In-app updates for Tauri applications. @@ -67,8 +67,8 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { check } from '@tauri-apps/plugin-updater'; -import { relaunch } from '@tauri-apps/plugin-process'; +import { check } from "@tauri-apps/plugin-updater"; +import { relaunch } from "@tauri-apps/plugin-process"; const update = await check(); if (update.response.available) { await update.downloadAndInstall(); diff --git a/plugins/upload/README.md b/plugins/upload/README.md index a45495a7..1a6ff69b 100644 --- a/plugins/upload/README.md +++ b/plugins/upload/README.md @@ -1,4 +1,4 @@ -![plugin-upload](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/upload/banner.png) +![plugin-upload](banner.png) Upload files from disk to a remote server over HTTP. Download files from a remote HTTP server to disk. @@ -61,24 +61,24 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { upload } from '@tauri-apps/plugin-upload'; +import { upload } from "@tauri-apps/plugin-upload"; upload( - 'https://example.com/file-upload', - './path/to/my/file.txt', + "https://example.com/file-upload", + "./path/to/my/file.txt", (progress, total) => console.log(`Uploaded ${progress} of ${total} bytes`), // a callback that will be called with the upload progress - { 'Content-Type': 'text/plain' } // optional headers to send with the request + { "Content-Type": "text/plain" }, // optional headers to send with the request ); ``` ```javascript -import { download } from 'tauri-plugin-upload-api'; +import { download } from "tauri-plugin-upload-api"; download( - 'https://example.com/file-download-link', - './path/to/save/my/file.txt', + "https://example.com/file-download-link", + "./path/to/save/my/file.txt", (progress, total) => console.log(`Downloaded ${progress} of ${total} bytes`), // a callback that will be called with the download progress - { 'Content-Type': 'text/plain' } // optional headers to send with the request + { "Content-Type": "text/plain" }, // optional headers to send with the request ); ``` diff --git a/plugins/websocket/README.md b/plugins/websocket/README.md index 22f4e9c2..59f80ed7 100644 --- a/plugins/websocket/README.md +++ b/plugins/websocket/README.md @@ -1,4 +1,4 @@ -![plugin-websocket](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/websocket/banner.png) +![plugin-websocket](banner.png) Expose a WebSocket server to your Tauri frontend. @@ -60,11 +60,11 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import WebSocket from '@tauri-apps/plugin-websocket'; +import WebSocket from "@tauri-apps/plugin-websocket"; -const ws = await WebSocket.connect('wss://example.com'); +const ws = await WebSocket.connect("wss://example.com"); -await ws.send('Hello World'); +await ws.send("Hello World"); await ws.disconnect(); ``` diff --git a/plugins/window-state/README.md b/plugins/window-state/README.md index e5e4b915..ea03f8e2 100644 --- a/plugins/window-state/README.md +++ b/plugins/window-state/README.md @@ -1,4 +1,4 @@ -![plugin-window-state](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/window-state/banner.png) +![plugin-window-state](banner.png) Save window positions and sizes and restore them when the app is reopened. @@ -71,7 +71,7 @@ app.save_window_state(StateFlags::all()); // will save the state of all open win or through Javascript ```javascript -import { saveWindowState, StateFlags } from '@tauri-apps/plugin-window-state'; +import { saveWindowState, StateFlags } from "@tauri-apps/plugin-window-state"; saveWindowState(StateFlags.ALL); ``` @@ -91,7 +91,7 @@ or through Javascript import { restoreStateCurrent, StateFlags, -} from '@tauri-apps/plugin-window-state'; +} from "@tauri-apps/plugin-window-state"; restoreStateCurrent(StateFlags.ALL); ``` diff --git a/plugins/window/README.md b/plugins/window/README.md index 5c9854f0..03dcc509 100644 --- a/plugins/window/README.md +++ b/plugins/window/README.md @@ -1,4 +1,4 @@ -![plugin-window](https://github.com/tauri-apps/plugins-workspace/blob/0417b7ad6047694cf101592ed65b41dc006df5ea/plugins/window/banner.png) +![plugin-window](banner.png) Interact with the Tauri window. @@ -60,19 +60,19 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { appWindow, WebviewWindow } from '@tauri-apps/plugin-window'; +import { appWindow, WebviewWindow } from "@tauri-apps/plugin-window"; // manipulating this window await appWindow.setResizable(false); // Creating new windows: // loading embedded asset: -const webview = new WebviewWindow('theUniqueLabel', { - url: 'path/to/page.html', +const webview = new WebviewWindow("theUniqueLabel", { + url: "path/to/page.html", }); // alternatively, load a remote URL: -const webview = new WebviewWindow('theUniqueLabel', { - url: 'https://github.com/tauri-apps/tauri', +const webview = new WebviewWindow("theUniqueLabel", { + url: "https://github.com/tauri-apps/tauri", }); ```