How to use the gzip-size.file function in gzip-size

To help you get started, we’ve selected a few gzip-size examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zeit / next.js / packages / next / build / utils.ts View on Github external
const fsStatGzip = (file: string) => {
  if (fileGzipStats[file]) return fileGzipStats[file]
  fileGzipStats[file] = gzipSize.file(file)
  return fileGzipStats[file]
}
github Automattic / wp-calypso / bin / loader-stats.js View on Github external
	const fileSizePromises = section.filesToLoad.map( f => gzipSize.file( f ) );
	const fileSizes = await Promise.all( fileSizePromises );
github scurker / currency.js / docs / src / build-docs.js View on Github external
(async () => {
  metalsmith(path.resolve(__dirname, '../'))
    .source('.')
    .use(ignore('src/**/*'))
    .metadata({
      title: 'currency.js',
      description: pkg.description,
      version: pkg.version,
      dist: pkg.browser,
      size: prettyBytes(await gzipSize.file(path.resolve(__dirname, '../../', pkg.browser)))
    })
    .use(markdown({
      highlight: hljs
    }))
    .use(tableOfContents)
    .use(hbs)
    .use(concatFiles)
    .use(layout)
    .build(err => {
      if(err) {
        throw err;
      }
    });
})();
github luwes / sinuous / bench / src / benchmarks.js View on Github external
async function run() {
    return gzipSize.file(path.resolve(`./libs/${lib}/dist/main.js`));
  }
github GoogleChromeLabs / squoosh / config / size-report.js View on Github external
results.files.map(async (entry) => ({
      name: entry.path,
      gzipSize: await gzipSize.file(entry.fullPath),
      size: entry.stat.size,
    })),
  );

gzip-size

Get the gzipped size of a string or buffer

MIT
Latest version published 2 years ago

Package Health Score

73 / 100
Full package analysis