npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, πŸ‘‹, I’m Ryan HefnerΒ  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you πŸ™

Β© 2024 – Pkg Stats / Ryan Hefner

astro-min

v1.3.1

Published

Extremely ⚑ fast and smart 🟠 HTML 🟑 JS πŸ”΅ CSS 🟣 SVG minification for Astro πŸš€ based on Rust πŸ¦€

Downloads

604

Readme

✳ AstroMin

Extremely fast and smartπŸ”Ή Minification of 🟠 HTML 🟑 JS πŸ”΅ CSS 🟣 SVG
Meticulously optimized for Speed πŸ₯‡ and Effectiveness πŸ… based on Rust πŸ¦€

Built with Astro GitHub Repo Stars NPM Package Version License: MIT Types Socket Badge

Feature Highlights ✨

  • ⚑ Performant parallel processing (+1k files/s)
  • πŸͺΆ Lighter build output (~25% smaller)
  • πŸ“¦ small packaged size (~30KB)

Feature Roadmap 🌱

  • [x] HTML, CSS, JS, SVG
  • [x] Files and inline Code
  • [x] Static Site Minification

Note

astro-min focuses on compressing statically generated content and pre-rendered routes

  • [ ] Support SSR / Hybrid Rendering
  • [ ] Remove Comments from external CSS/JS

Getting started 🎯

Use your package manager of your choice

# NPM
npm run astro add astro-min

# Bun (known bug πŸ›)
#bun astro add astro-min

# PNPM
pnpm astro add astro-min

# Yarn
yarn astro add astro-min

Manual Installation πŸ§‘β€πŸ’»

  1. Install package astro-min

  2. Import and add to integrations list

//astro.config.mjs
import { defineConfig } from 'astro/config'
import min from 'astro-min'

export default defineConfig({
  integrations: [min()]
})

Options πŸ”§

//astro.config.mjs
import { defineConfig } from 'astro/config'
import minify from 'astro-min'

export default defineConfig({
  integrations: [
    minify({
      do_not_minify_doctype: false,
      ensure_spec_compliant_unquoted_attribute_values: false,
      keep_closing_tags: false,
      keep_comments: false,
      keep_html_and_head_opening_tags: false,
      keep_input_type_text_attr: false,
      keep_spaces_between_attributes: false,
      keep_ssi_comments: false,
      minify_css: false,
      minify_js: false,
      preserve_brace_template_syntax: false,
      preserve_chevron_percent_template_syntax: false,
      remove_bangs: false,
      remove_processing_instructions: false,
    })
  ]
})

[!IMPORTANT]

Use astro-min last in your integration list for the best optimization
Optional: but before astro-compressor and astro-compress for images only

//astro.config.mjs
import { defineConfig } from 'astro/config'
import compressor from 'astro-compressor'
import minify from 'astro-min'

export default defineConfig({
  integrations: [
    minify({
      // do_not_minify_doctype: false,
      // ensure_spec_compliant_unquoted_attribute_values: false,
      // keep_closing_tags: false,
      // keep_comments: false,
      // keep_html_and_head_opening_tags: false,
      // keep_input_type_text_attr: false,
      // keep_spaces_between_attributes: false,
      // keep_ssi_comments: false,
      // minify_css: false,
      // minify_js: false,
      // preserve_brace_template_syntax: false,
      // preserve_chevron_percent_template_syntax: false,
      // remove_bangs: false,
      // remove_processing_instructions: false,
    }),
    compress({
      CSS: false,
      HTML: false,
      Image: true,
      JavaScript: false,
      SVG: false
    }),
    compressor()
  ]
})

Development πŸ’»

Open in StackBlitz Open with CodeSandbox Open in GitHub Codespaces Open in Gitpod

Learn more πŸ”–

Versus πŸ…

Colophon πŸ“ƒ

Build with modern FOSS πŸ’š and AI assistance πŸ€–

Next generation ✨ web development based on Rust πŸ¦€

Changelog πŸ“–

1.2.0 - πŸ›  Feat: Parallel processing
- ✨ Feat: Skip *.min.*
1.1.0 - πŸ› Fix: Auto install bug

Advanced Astro