package
Measure the size of your npm package distribution
npm install pkg-sizeGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
170.2 kB
Includes dependencies.
Measure the size of your npm package distribution
⚡️ Try it in your npm package
$ npx pkg-sizeIf you like this project, please star it & follow me to see what other cool projects I'm working on! ❤️
pack/publish Collects publish files as specified in your package.json!npm i pkg-sizeconst pkgSize = require('pkg-size');
// Get package size data from current working directory
const sizeData = await pkgSize();
// Get package size data from a specific package path
const sizeData = await pkgSize('/path/to/package');type FileEntry = {
path: string;
mode: number;
size: number;
sizeGzip: number;
sizeBrotli: number;
};
type PkgSizeData = {
pkgPath: string;
tarballSize: number;
files: FileEntry[];
};
function pkgSize(pkgPath?: string): Promise<PkgSizeData>;