# esbuild-analyzer

> A visualizer esbuild analyzer

Latest version **0.2.0** (published 2023-02-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install esbuild-analyzer
pnpm add esbuild-analyzer
yarn add esbuild-analyzer
bun add esbuild-analyzer
```

Provides the command `esbuild-analyzer`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2023-02-17 |
| First published | 2022-12-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 933.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | shuoshubao |
| Maintainers | shuoshubao |
| Keywords | esbuild, plugin, analyze, analyzer, visualizer |

## Links

- npm: https://www.npmjs.com/package/esbuild-analyzer
- Repository: https://github.com/shuoshubao/esbuild-analyzer
- Homepage: https://github.com/shuoshubao/esbuild-analyzer#readme
- Issues: https://github.com/shuoshubao/esbuild-analyzer/issues
- npm.io page: https://npm.io/package/esbuild-analyzer

## Dependencies (2)

- [pako](https://npm.io/package/pako.md) ^2.1.0
- [yargs](https://npm.io/package/yargs.md) ^17.6.2

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2023-02-17
- 0.1.4 — 2023-01-14
- 0.1.3 — 2023-01-14
- 0.1.2 — 2022-12-28
- 0.1.1 — 2022-12-28
- 0.1.0 — 2022-12-28

## README

# esbuild-analyzer

A visualizer esbuild analyzer

# Examples

- https://shuoshubao.github.io/esbuild-analyzer
- https://shuoshubao.github.io/esbuild-analyzer/demo1

# Install

```sh
npm i -D esbuild-analyzer
```

# Usage

## api

### .build

```js
const esbuild = require('esbuild')
const AnalyzerPlugin = require('esbuild-analyzer')

esbuild.build({
  entryPoints: ['lib/index.js'],
  outdir: 'dist',
  bundle: true,
  metafile: true,
  plugins: [AnalyzerPlugin()]
})
```

### .buildSync

```js
const { writeFileSync } = require('fs')
const esbuild = require('esbuild')
const { getEsbuildAnalyzerHtml } = require('esbuild-analyzer')

const result = esbuild.buildSync({
  entryPoints: ['lib/index.js'],
  outdir: 'dist',
  bundle: true,
  metafile: true
})

const html = getEsbuildAnalyzerHtml(result.metafile)

writeFileSync('EsbuildAnalyzer.html', html)
```

## cli

```sh
# https://esbuild.github.io/api/#metafile
esbuild lib/index.js --outdir=dist --bundle --metafile=meta.json
```

```sh
npx esbuild-analyzer

# Custom parameters
npx esbuild-analyzer --metafile=meta.json --outfile=EsbuildAnalyzer.html
```

---
_Source: https://npm.io/package/esbuild-analyzer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
