{"id":20823136,"url":"https://github.com/developmint/brotli-fsize","last_synced_at":"2025-12-24T12:54:24.292Z","repository":{"id":57147444,"uuid":"166485695","full_name":"Developmint/brotli-fsize","owner":"Developmint","description":"Get the brotli-compressed size of a string or buffer","archived":false,"fork":false,"pushed_at":"2019-01-22T11:34:24.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-18T19:40:11.343Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Developmint.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-18T23:34:41.000Z","updated_at":"2021-02-11T05:18:02.000Z","dependencies_parsed_at":"2022-09-06T14:51:53.217Z","dependency_job_id":null,"html_url":"https://github.com/Developmint/brotli-fsize","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developmint%2Fbrotli-fsize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developmint%2Fbrotli-fsize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developmint%2Fbrotli-fsize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developmint%2Fbrotli-fsize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Developmint","download_url":"https://codeload.github.com/Developmint/brotli-fsize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243172110,"owners_count":20247884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T22:17:25.037Z","updated_at":"2025-12-24T12:54:24.241Z","avatar_url":"https://github.com/Developmint.png","language":"JavaScript","readme":"# brotli-fsize [![Build Status](https://travis-ci.org/Developmint/brotli-fsize.svg?branch=master)](https://travis-ci.org/Developmint/brotli-fsize)\n\n\u003e Get the brotli-compressed size of a string or buffer\n\n\n## Install\n\n**Attention:** This module is based on the **native** Brotli support, starting with\nNode version **11.7.0**. Therefore it will only work with Node version equal to or higher.\n\n```\n$ npm install brotli-fsize\n```\n\n\n## Usage\n\n```js\nconst brotliSize = require('brotli-fsize');\nconst 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.';\n\nconsole.log(text.length);\n//=\u003e 191\n\nconsole.log(brotliSize.sync(text));\n//=\u003e 134\n```\n\n\n## API\n\n### brotliSize(input, [options])\n\nReturns a `Promise` for the size.\n\n### brotliSize.sync(input, [options])\n\nReturns the size.\n\n#### input\n\nType: `string` `Buffer`\n\n#### options\n\nType: `Object`\n\nAny [`brotli` option](https://nodejs.org/api/zlib.html#zlib_class_brotlioptions).\n\n### brotliSize.stream([options])\n\nReturns a [`stream.PassThrough`](https://nodejs.org/api/stream.html#stream_class_stream_passthrough). The stream emits a `brotli-fsize` event and has a `brotliSize` property.\n\n### brotliSize.file(path, [options])\n\nReturns a `Promise` for the size of the file.\n\n#### path\n\nType: `string`\n\n### brotliSize.fileSync(path, [options])\n\nReturns the size of the file.\n\n\n\n## License\n\nInspired by [gzip-size](https://github.com/sindresorhus/gzip-size#readme)\n\n\nMIT © Developmint (Alexander Lichter)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmint%2Fbrotli-fsize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopmint%2Fbrotli-fsize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmint%2Fbrotli-fsize/lists"}