/esbuild-os-notifier

Esbuild plugin for receive OS notification when your build finish

Primary LanguageTypeScriptMIT LicenseMIT

esbuild-os-notifier

NPM Version NPM Downloads npm bundle size

Esbuild plugin for receive OS notification when your build finish, have an error or a warning

📦 Install

yarn add dev esbuild-os-notifier

or

npm i -D esbuild-os-notifier

🚀 Usage

Add it to your esbuild plugins list:

// ESM example with import
import { build } from 'esbuild'
import esbuildOsNotifier from 'esbuild-os-notifier'

build({
  ...
  plugins: [
    esbuildOsNotifier()
  ]
  ...
});
// CommonJs example with require
const esbuild = require("esbuild");
const esbuildOsNotifier = require('esbuild-os-notifier')

esbuild.build({
  ...
  plugins: [
    esbuildOsNotifier()
  ]
  ...
});

Options

You can add your own custom configuration of options to esbuildOsNotifier

esbuildOsNotifier({
    // Options from "node_notifier"
    contentImage: '' // Path to png image (Recomend 300x300px) for display in the notification
    sound: true, // Only Notification Center or Windows Toasters (true/false)
    timeout: 5000, // Time (in milliseconds) to clear the notifications
  }, 
  {
    // Show or disable notifications for error, warnings or sucess
    warnings: false,
    errors: true,
    success: true
  });