Skip to content

@leafer-editor/worker ​

Based on @leafer-ui/worker, this package introduces plugins including graphics editor, text editor, viewport, view control, scrollbar, arrow, HTML, element search, export elements, and scale-fixed plugin, making it suitable for online graphics editing 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-editor/worker
sh
pnpm add @leafer-editor/worker
sh
yarn add @leafer-editor/worker
sh
bun add @leafer-editor/worker

Or import via importScripts ​

Access internal features through the global variable LeaferUI.

js
importScripts(
  'https://unpkg.com/@leafer-editor/worker@2.3.1/dist/worker.min.js',
)
js
importScripts('https://unpkg.com/@leafer-editor/worker@2.3.1/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.