Skip to main content

Editor42 installed from NPM

When to use

When your project has a bundler — Vite, Webpack, Rollup — and you want the editor to be a dependency like any other, versioned in your lockfile rather than fetched from a CDN at run time.

How it works

import editor42 from 'editor42' and call editor42.init(). The one extra option is base_url: a bundler moves your code into a hashed file, so the editor cannot find its own skins, icons and plugins by itself. Point it at the CDN, as here, or at a copy of those folders in your public directory.

How to start using

Install the editor as a package and import it: npm install editor42. A bundler rewrites your code into a hashed file, so tell the editor where its skins, icons, themes and plugins live with base_url — the CDN, or your own copy of them.

See the NPM install page for both options.