Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
brotli-fsize
Advanced tools
Get the brotli-compressed size of a string or buffer
Attention: This module is based on the native Brotli support, starting with Node version 11.7.0. Therefore it will only work with Node version equal to or higher.
$ npm install brotli-fsize
const brotliSize = require('brotli-fsize');
const text = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.';
console.log(text.length);
//=> 191
console.log(brotliSize.sync(text));
//=> 134
Returns a Promise
for the size.
Returns the size.
Type: string
Buffer
Type: Object
Any brotli
option.
Returns a stream.PassThrough
. The stream emits a brotli-fsize
event and has a brotliSize
property.
Returns a Promise
for the size of the file.
Type: string
Returns the size of the file.
Inspired by gzip-size
MIT © Developmint (Alexander Lichter)
1.0.3 (2019-01-22)
<a name="1.0.2"></a>
FAQs
Get the brotli-compressed size of a string or buffer
The npm package brotli-fsize receives a total of 279 weekly downloads. As such, brotli-fsize popularity was classified as not popular.
We found that brotli-fsize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.