UNPKG

@sizium/core

Version:

Get the actual size of any local or remote package

39 lines (36 loc) 1.35 kB
import { c as PackageSuper, S as SiziumResponse } from '../shared/core.Cm22qaRF.js'; import '@schemastore/package'; /** * Represents the class to get the `true` package size from **local** enviroment. * * @example * // Directory input * const size = new SiziumLocal( './' ) * const data = await size.get() * @example * // package.json input * const size = new SiziumLocal( './package.json' ) * const data = await size.get() * @example * // remote package.json input * const size = new SiziumLocal( 'https://raw.githubusercontent.com/chalk/chalk/refs/heads/main/package.json' ) * const data = await size.get() * @example * // package.json string input * const pkg = {name: 'chalk', ... } * const size = new SiziumLocal(JSON.stringify(pkg) ) * const data = await size.get() */ declare class SiziumLocal extends PackageSuper { #private; /** * Retrieves the package size information from a local environment. * It processes the package data from the input, resolving dependencies * and aggregating package data to return a comprehensive size response. * * @returns {Promise<SiziumResponse>} A promise that resolves with the package response data, * including size and dependency information. */ get(): Promise<SiziumResponse>; } export { SiziumLocal };