Registry / devops / esbuild-os-notifier

esbuild-os-notifier

JSON →
library1.1.1jsnpmunverified

esbuild-os-notifier (v1.1.1) is a plugin for esbuild that triggers native OS notifications when builds finish, error, or warn. It wraps node-notifier to support macOS, Windows, and Linux. Allows customization of notification content, sound, timeout, and selective enabling of success/error/warning alerts. Currently stable with monthly releases. Differentiators: minimal config, built-in TypeScript types, and simple API compared to alternatives like esbuild-plugin-notify.

npm install esbuild-os-notifier
INSTALL
IMPORT
SIG · ESBUILD-OS-NOTIFIE
E
esbuild-os-notifier
devopsjavascriptv1.1.1
harness data pending
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.

default
import esbuildOsNotifier from 'esbuild-os-notifier'
import { esbuildOsNotifier } from 'esbuild-os-notifier'
Default export, not named. CommonJS require works as shown.
default (require)
const esbuildOsNotifier = require('esbuild-os-notifier')
CommonJS usage. Returns the default export.
esbuildOsNotifier (type)
import type { EsbuildOsNotifierOptions } from 'esbuild-os-notifier'
import { EsbuildOsNotifierOptions } from 'esbuild-os-notifier'
Type is exported for TypeScript usage with import type.

Initializes esbuild with the OS notifier plugin, triggering a desktop notification on build completion or failure.

import { build } from 'esbuild'; import esbuildOsNotifier from 'esbuild-os-notifier'; build({ entryPoints: ['src/index.js'], outfile: 'dist/index.js', bundle: true, plugins: [esbuildOsNotifier()], }).catch(() => process.exit(1));
Debug
Known issues
gotchaThe plugin does not forward esbuild's result object; you cannot access build results inside the notification callback.
fix
Use separate esbuild hooks if you need result handling.
affects: >=0.0.0
deprecatednode-notifier v10+ removed support for some Linux notification backends; upgrades may break on older Linux distributions.
fix
Pin node-notifier to v9 if needed, or test on your target systems.
affects: >=1.0.0
gotchaPassing options incorrectly (e.g., nested object order) can cause TypeScript errors.
fix
Use the correct signature: esbuildOsNotifier(notificationOptions, eventOptions).
affects: >=1.0.0
gotchaThe plugin does not work in non-interactive environments (e.g., CI) where desktop notifications are absent.
fix
Wrap plugin conditionally with an environment check.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: esbuildOsNotifier is not a function
Importing named export instead of default.
fix
Use default import: import esbuildOsNotifier from 'esbuild-os-notifier'
Cannot find module 'node-notifier'
Missing peer dependency node-notifier.
fix
Install it: npm install node-notifier
error TS2339: Property 'esbuildOsNotifier' does not exist on type 'typeof import(...)'
Trying to import as named export instead of default.
fix
Use import esbuildOsNotifier from 'esbuild-os-notifier'
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies
node-notifierrequiredunderlying notification library
esbuildrequiredpeer dependency for plugin usage
Agent activity
2 hits · last 30 days
node
2
Resources
esbuild-os-notifier — npm install esbuild-os-notifier · libregistry