Skip to content

@leafer-draw/worker

Compared to @leafer-ui/worker, this package reduces features such as App and event interactions, making it suitable for pure drawing scenarios.

web version     worker version     node version     mini program version

Runs in a Web Worker multithreaded background environment and cannot operate the DOM.

The web version and worker version can coexist in the same project and be used together as needed.

Installation

sh
npm install @leafer-draw/worker
sh
pnpm add @leafer-draw/worker
sh
yarn add @leafer-draw/worker
sh
bun add @leafer-draw/worker

Or import via importScripts

Access internal features through the global variable LeaferUI.

js
importScripts('https://unpkg.com/@leafer-draw/worker@2.1.0/dist/worker.min.js')
js
importScripts('https://unpkg.com/@leafer-draw/worker@2.1.0/dist/worker.js')

Update

Learn how to quickly update versions.

Usage

The usage, global variables, and @leafer-ui/worker are consistent. You only need to change the package name to run the official example code.

Released under the MIT License.