Registry / devops / esbuild-plugin-bookmarklet

esbuild-plugin-bookmarklet

JSON →
library1.1.0jsnpmunverified

An ESM-only, Deno-first esbuild plugin that generates bookmarklet code from JavaScript entry points. Current stable version 1.1.0 (2024) is covered by semver. It wraps esbuild output into a URL-encoded bookmarklet, requiring `iife` format and `write: false`. Differentiators: Deno-first (supports Node), simple setup, supports multiple entry points since v1.1.0.

devops
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESM-only; CommonJS require will fail. Use import statement.

import bookmarkletPlugin from 'esbuild-plugin-bookmarklet'

Deno import should pin a version (e.g., @1.1.0) to avoid breaking changes.

import bookmarkletPlugin from 'https://deno.land/x/esbuild_plugin_bookmarklet@1.1.0/mod.js'

Ensure package.json has 'type': 'module' or use .mjs extension.

import bookmarkletPlugin from 'esbuild-plugin-bookmarklet' // in Node ESM

Minimal Node ESM build script that outputs a bookmarklet from index.js.

import * as esbuild from 'esbuild'; import bookmarkletPlugin from 'esbuild-plugin-bookmarklet'; await esbuild.build({ entryPoints: ['index.js'], bundle: true, minify: true, outfile: 'bookmarklet.js', write: false, format: 'iife', plugins: [bookmarkletPlugin], target: ['chrome58', 'firefox57', 'safari11', 'edge16'] }); console.log('Bookmarklet generated as bookmarklet.js');
Debug
Known footguns
breakingRequires esbuild's `write: false` option; output is handled by plugin, not filesystem.
gotchaPlugin only works with `format: 'iife'`; other formats may produce invalid bookmarklets.
deprecatedDeno import without version pin may break with future releases.
gotchaESM-only package; using require() results in error: require() of ES Module not supported.
gotchaMultiple entry points are supported since v1.1.0; earlier versions only handle single entry.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
10 hits · last 30 days
gptbot
3
ahrefsbot
3
claudebot
3
bingbot
1
Resources