
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
astro-compressor
Advanced tools
A gzip, brotli and zstd compressor for Astro
brotli
, zstd
, gzip
, oh my[!NOTE] This only works for static exports, SSR does not export assets that can be compressed ahead of time so you need to solve it with middleware. See this for more context and a partial solution.
Install via your tool of choice:
# Using NPM
npx astro add astro-compressor
# Using Yarn
yarn astro add astro-compressor
# Using PNPM
pnpm astro add astro-compressor
To compress your files, simply run pnpm build
and look for the compression messages in the build log.
[!IMPORTANT] It is important that this is the last integration in the
integrations
property to ensure all the generated files are compressed.
First, install the package with your favorite package manager: pnpm add --dev astro-compressor
,
then configure it in your astro.config.*
file in the integrations
property:
import { defineConfig } from "astro/config";
import compressor from "astro-compressor";
export default defineConfig({
// ...
integrations: [..., compressor()],
});
You can also optionally enable and/or disable either the gzip or brotli compression by passing an options object to the compressor:
import { defineConfig } from "astro/config";
import compressor from "astro-compressor";
export default defineConfig({
// ...
integrations: [..., compressor({ gzip: true, brotli: false })],
});
Or customize the file formats that will be compressed:
import { defineConfig } from "astro/config";
import compressor from "astro-compressor";
export default defineConfig({
// ...
integrations: [..., compressor({
fileExtensions: [".html"] // only compress HTML files
})],
});
By default, the fileExtensions
array is [".css", ".js", ".html", ".xml", ".cjs", ".mjs", ".svg", ".txt"]
.
MIT.
v1.1.2
2025-08-06
Documentation update to mention zstd
compression alongside other compression algorithms.
c9d3fd7
] Mention zstd alongside other compression algorithmsFAQs
A gzip, brotli and zstd compressor for Astro
The npm package astro-compressor receives a total of 8,307 weekly downloads. As such, astro-compressor popularity was classified as popular.
We found that astro-compressor demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.