Registry / devops / esbuild-plugin-time

esbuild-plugin-time

JSON →
library1.0.0jsnpmunverified

A simple esbuild plugin that measures and logs the build time. Current stable version is 1.0.0. It is a lightweight, zero-configuration plugin that wraps esbuild's build process to report duration. No breaking changes known, minimal API surface. Use it to gain insight into build performance with minimal overhead.

npm install esbuild-plugin-time
INSTALL
IMPORT
SIG · ESBUILD-PLUGIN-TIM
E
esbuild-plugin-time
devopsjavascriptv1.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

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

default export (time)
import time from 'esbuild-plugin-time'
const time = require('esbuild-plugin-time')
The package exports a single function as default. Use ESM import. For CommonJS, use dynamic import or wrap with require (not official).
require (CommonJS)
const time = require('esbuild-plugin-time').default || require('esbuild-plugin-time')
const time = require('esbuild-plugin-time')
In CommonJS, the default export is not directly accessible; you may need to access .default or rely on the package's CJS compatibility. Use ESM when possible.
TypeScript usage
import time from 'esbuild-plugin-time'
import { time } from 'esbuild-plugin-time'
The package does not export named 'time', only default. TypeScript users must import the default export. No types provided; use @types/esbuild or define your own.

Shows basic setup: import esbuild and the plugin, then use time() in the plugins array to log build duration.

import esbuild from 'esbuild'; import time from 'esbuild-plugin-time'; await esbuild.build({ entryPoints: ['./src/index.js'], bundle: true, outfile: './dist/index.js', plugins: [ time(), ], });
Debug
Known issues
gotchaThe plugin always logs to console.log; cannot be silenced or redirected.
fix
No workaround. If you need silent builds, consider forking or not using this plugin.
affects: >=1.0.0
gotchaNo TypeScript definitions provided; you may encounter type errors if using strict TypeScript.
fix
Create your own type declaration file (e.g., declare module 'esbuild-plugin-time') or use @ts-ignore.
affects: >=1.0.0
gotchaPlugin does not support watch mode; duration is measured only for a single build invocation.
fix
If using watch mode, expect the timer to reset with each rebuild but no special behavior.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'esbuild-plugin-time'
Package not installed or used without installing esbuild as a dependency.
fix
Run npm install --save-dev esbuild esbuild-plugin-time
require() of ES Module not supported
Using require() in a CommonJS context for an ESM-only package.
fix
Use dynamic import: const time = (await import('esbuild-plugin-time')).default; or switch to ESM.
TypeError: time is not a function
Importing as named export 'time' instead of default.
fix
Use import time from 'esbuild-plugin-time' (default import).
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
esbuildrequiredpeer dependency: the plugin works with esbuild's build API
Agent activity
2 hits · last 30 days
node
2
Resources
esbuild-plugin-time — npm install esbuild-plugin-time · libregistry