7.3.14 • Published 8 months ago

package-build-stats v7.3.14

Weekly downloads
165
License
MIT
Repository
github
Last release
8 months ago

This is the function that powers the core of building, minifying and gzipping of packages in bundlephobia.

Usage

const { getPackageStats } = require('package-build-stats')

Building packages from npm

Building the latest stable version
const results = await getPackageStats('moment')
Building a specific version / tag
const results = await getPackageStats('moment@2.24.0')
Building local packages (beta)
const results = await getPackageStats('~/dev/my-npm-package') // must have a package.json

Passing options to the build

const results = await getBuiltPackageStats('moment', options)
Options
OptionValuesDefaultDescription
clientnpm or yarnnpmWhich client to use to install package for building
limitConcurrencytrue or falsefalseWhen using yarn as the client, use the network mutex to limit concurrency
networkConcurrencynumberfalseWhen using yarn as client, limit simultaneous installs to this number.
customImportsArray<string>nullBy default, the default export is used for calculating sizes. Setting this option allows calculation of package stats based on more granular top-level exports.
minifierterser or esbuildterserESbuild is faster, albeit with marginally larger file sizes
installTimeoutnumber (ms)30000Timeout for package install

Listening to events

package-build-stats emits various lifecycle events when building a package. You can listen to these events by subscribing to the event emitter (based on mitt).

import { eventQueue } from 'package-build-stats'

// Listen to all events
eventQueue.on('*', callback)

// Listen to specific events
eventQueue.on('TASK_PACKAGE_BUILD', callback)

For a list of all events, see this.

Contributing

See contributing guide.

7.3.14

8 months ago

7.3.13

2 years ago

7.3.10

2 years ago

7.3.12

2 years ago

7.3.11

2 years ago

8.0.0-beta.6

2 years ago

8.0.0-beta.5

2 years ago

8.0.0-beta.2

2 years ago

8.0.0-beta.1

2 years ago

8.0.0-beta.4

2 years ago

8.0.0-beta.3

2 years ago

7.3.8

2 years ago

7.3.7

2 years ago

7.3.6

2 years ago

7.3.1

2 years ago

7.3.0

2 years ago

7.3.5

2 years ago

7.3.3

2 years ago

7.3.2

2 years ago

7.2.4

3 years ago

7.2.3

3 years ago

7.2.2

3 years ago

7.2.1

3 years ago

7.2.0

3 years ago

7.1.0

3 years ago

7.0.2

3 years ago

7.0.1

3 years ago

7.0.0

3 years ago

6.2.2

4 years ago

6.2.1

4 years ago

6.2.0

4 years ago

6.1.2

4 years ago

6.1.1

4 years ago

6.1.0

4 years ago

6.0.1

5 years ago

6.0.0

5 years ago

5.1.1

5 years ago

5.1.0

5 years ago

5.0.0

5 years ago

4.1.0

5 years ago

4.0.5

5 years ago

4.0.4

5 years ago

4.0.3

5 years ago

4.0.2

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.5.6

6 years ago

3.5.5

6 years ago

3.5.4

6 years ago

3.5.3

6 years ago

3.5.2

6 years ago

3.5.1

6 years ago

3.5.0

6 years ago

3.4.1

6 years ago

3.4.0

6 years ago

3.3.1

6 years ago

3.3.0

6 years ago

3.2.2

6 years ago

3.2.1

6 years ago

3.2.0

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.0

6 years ago

2.4.0

6 years ago

2.3.4

6 years ago

2.3.3

6 years ago

2.3.2

6 years ago

2.3.1

6 years ago

2.3.0

6 years ago

2.2.0

6 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.7

6 years ago

2.0.6

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago