package-build-stats
```js const getBuiltPackageStats = require('package-build-stats') ```
Last updated a month ago by pastelsky .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install package-build-stats 
SYNC missed versions from official npm registry.

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

Usage

const getBuiltPackageStats = require('package-build-stats')

Building packages from npm

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

Passing options to the build

const results = await getBuiltPackageStats('moment', options)
Options
Option Values Default Description
client npm or yarn npm Which client to use to install package for building
limitConcurrency true or false false When using yarn as the client, use the network mutex to limit concurrency
networkConcurrency number false When using yarn as client, limit simultaneous installs to this number.
customImports Array<string> null By default, the default export is used for calculating sizes. Setting this option allows calculation of package stats based on more granular top-level exports.

Contributing

  1. Clone this repo, run yarn install
  2. To make it easier to test changes when develop, you can start an HTTP server that uses REST APIs to report size of packages.

To start the server, run –

yarn run start

The server runs at port 3000.

To build a package and get its build stats, run a curl request like so -

curl 'localhost:3000/size?p=<package-name>'

eg.

curl 'localhost:3000/size?p=react'

To build a package and get stats about exports that are exposed out of the package –

curl 'localhost:3000/exports?p=<package-name>'

To build a package and get stats about size of various exports that are exposed out of the package –

curl 'localhost:3000/export-sizes?p=<package-name>'

Current Tags

  • 6.2.2                                ...           latest (a month ago)

61 Versions

  • 6.2.2                                ...           a month ago
  • 6.2.1                                ...           a month ago
  • 6.2.0                                ...           2 months ago
  • 6.1.2                                ...           5 months ago
  • 6.1.1                                ...           5 months ago
  • 6.1.0                                ...           5 months ago
  • 6.0.1                                ...           9 months ago
  • 6.0.0                                ...           9 months ago
  • 5.1.1                                ...           9 months ago
  • 5.1.0                                ...           9 months ago
  • 5.0.0                                ...           10 months ago
  • 4.1.0                                ...           2 years ago
  • 4.0.5                                ...           2 years ago
  • 4.0.4                                ...           2 years ago
  • 4.0.3                                ...           2 years ago
  • 4.0.2                                ...           2 years ago
  • 4.0.1                                ...           2 years ago
  • 4.0.0                                ...           2 years ago
  • 3.5.6                                ...           2 years ago
  • 3.5.5                                ...           2 years ago
  • 3.5.4                                ...           2 years ago
  • 3.5.3                                ...           2 years ago
  • 3.5.2                                ...           2 years ago
  • 3.5.1                                ...           2 years ago
  • 3.5.0                                ...           2 years ago
  • 3.4.1                                ...           2 years ago
  • 3.4.0 [deprecated]           ...           2 years ago
  • 3.3.1                                ...           2 years ago
  • 3.3.0                                ...           2 years ago
  • 3.2.2                                ...           2 years ago
  • 3.2.1                                ...           2 years ago
  • 3.2.0                                ...           2 years ago
  • 3.1.1                                ...           2 years ago
  • 3.1.0                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 2.4.0                                ...           2 years ago
  • 2.3.4                                ...           2 years ago
  • 2.3.3                                ...           2 years ago
  • 2.3.2                                ...           2 years ago
  • 2.3.1                                ...           2 years ago
  • 2.3.0                                ...           2 years ago
  • 2.2.0                                ...           2 years ago
  • 2.1.3                                ...           2 years ago
  • 2.1.2                                ...           2 years ago
  • 2.1.1 [deprecated]           ...           2 years ago
  • 2.1.0 [deprecated]           ...           2 years ago
  • 2.0.7                                ...           2 years ago
  • 2.0.6                                ...           2 years ago
  • 2.0.5                                ...           2 years ago
  • 2.0.4                                ...           2 years ago
  • 2.0.3                                ...           2 years ago
  • 2.0.2 [deprecated]           ...           2 years ago
  • 2.0.1 [deprecated]           ...           2 years ago
  • 2.0.0 [deprecated]           ...           2 years ago
  • 1.2.1                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.1                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 91
Dependencies (39)
Dev Dependencies (6)

Copyright 2014 - 2017 © taobao.org |