@chronocide/package-size
v0.0.1
Published
<div align="center"> <h1>@chronocide/package-size</h1> <p>Tiny package size calculator</p> <a href="/LICENSE"> <img alt="License AGPLv3" src="https://img.shields.io/badge/license-AGPLv3-blue.svg" /> </a> <a href="https://www.npmjs.com/
Readme
Install
Install using npm:
npm i @chronocide/package-sizeUsage
.\node_modules\@chronocide\package-sizeAPI
import psize from '@chronocide/package-size';
const size = await psize('dist');
console.log(size); // 1875import { tar, gzip } from '@chronocide/package-size';
const file = await tar('dist'); // <Buffer> (.tar)
const zip = await gzip(file); // <Buffer> (.tgz)
console.log(zip.byteLength) // 1875See /scripts/size.js for an example that automatically creates a size badge.
Why?
I couldn't find an package / online tool that was both small and gave me the size of only code. npm bundles package.json, README, LICENSE, main and bin, which are irrelevant when trying to determine the size of packages. @chronocide/package-size tries to solve that by only calculating the size of files defined in files.
