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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@osmn-byhn/css-formatter-cli

v1.0.5

Published

Command line interface for @osmn-byhn/css-formatter to inline or extract CSS from HTML

Downloads

463

Readme

CSS Formatter CLI

A powerful CLI for bidirectional CSS-HTML conversion, powered by @osmn-byhn/css-formatter.

This tool allows you to convert between external/internal CSS and inline styles effortlessly directly from your terminal. It's perfect for email templates, production optimization, and modernizing legacy HTML.

🚀 Key Features

  • Bidirectional Conversion: Move styles from <style> tags to inline attributes and back.
  • Smart Selector Generation: Automatically generates clean, semantic CSS selectors based on existing classes and structure.
  • Preserves Critical CSS: Keeps @media queries, :hover states, and @font-face rules in a <style> tag while inlining the rest.
  • Style Deduplication: Groups identical inline styles under single CSS rules to keep your output clean.

📦 Installation

You can install it globally via npm:

npm install -g @osmn-byhn/css-formatter-cli

Or run it instantly using npx:

npx css-formatter <command> [options]

🎯 Usage & Commands

1. Inlining CSS (inline)

Converts all CSS from <style> tags and linked stylesheets into inline style attributes.

css-formatter inline input.html -o output.html
  • Use Case: Preparing HTML for email clients that only support inline styles.

2. Extracting to Internal CSS (internal)

Extracts all inline style attributes and moves them into a single <style> tag in the <head>.

css-formatter internal input.html -o output.html
  • Use Case: Refactoring messy inline styles into a readable, centralized format.

3. Extracting to External CSS (extract)

Extracts inline styles into a separate .css file and adds a <link> tag to the HTML.

css-formatter extract input.html styles.css -o output.html
  • Use Case: Optimizing production websites for browser caching by separating CSS from HTML.

🔧 Options

| Argument | Description | | :--- | :--- | | <input> | Path to your input HTML file. | | [cssOutput] | (Extract only) Name of the generated CSS file. | | -o, --output | Custom path for the output HTML (defaults to overwriting input). | | -v, --version | Display version information. | | -h, --help | Display help for commands. |

📄 License

MIT © Osman Beyhan