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

@antharuu/mew

v1.0.3

Published

A lightweight CSS preprocessor with elegant BEM support

Downloads

17

Readme

Features

  • 🎯 BEM Support: Write cleaner CSS with automatic BEM class generation
  • 🔄 Nested Rules: Simplified syntax for nested selectors
  • 📦 Variables: Basic variable support for reusable values
  • 📁 Directory Processing: Process single files or entire directories
  • 🎨 Clean Output: Generate well-formatted CSS output

Installation

Via NPM (Recommended)

The easiest way to install Mew is through npm:

npm install -g @antharuu/mew

From Source

Alternatively, you can build from source:

# Clone the repository
git clone https://github.com/antharuu/Mew.git
cd Mew

# Build the project
cargo build --release

# The binary will be available in target/release/mew

Optional: Add to your PATH for system-wide access:

# Linux/macOS
echo 'export PATH="$PATH:/path/to/mew/target/release"' >> ~/.bashrc
source ~/.bashrc

# Windows - Add the release directory to your system's PATH environment variable

Usage

Process a single file:

mew input.mew

Process a directory:

mew ./styles

Syntax

Variables

$variable-name: value;

button {
  property: $variable-name;
}

Nesting with BEM

// You can omit the dot (recommended)
card {
  /* Becomes .card */

  &header {
    /* Becomes .card__header */
  }

  @primary {
    /* Becomes .card--primary */
  }
}

// Or use it explicitly if needed
.block {
  /* Also valid, becomes .block */
}

Pseudo-selectors

button {
  &:hover {
    /* Becomes .button:hover */
  }
}

Example

Input (.mew file)

$nav-bg: #ffffff;
$nav-spacing: 16px;

// No dot needed
nav {
  background: $nav-bg;
  padding: $nav-spacing;

  &list {
    display: flex;
    margin: 0;
    padding: 0;
  }

  &item {
    list-style: none;
    padding: $nav-spacing;

    &:hover {
      background: #f5f5f5;
    }
  }

  @mobile {
    padding: $nav-spacing;
  }
}

Output (.css file)

.nav {
    background: #ffffff;
    padding: 16px;
}

.nav__list {
    display: flex;
    margin: 0;
    padding: 0;
}

.nav__item {
    list-style: none;
    padding: 16px;
}

.nav__item:hover {
    background: #f5f5f5;
}

.nav--mobile {
    padding: 16px;
}

Current Limitations

  • No advanced functions (like darken, lighten, mix, etc.)
  • No mathematical operations beyond basic calculations
  • No import/include functionality
  • No mixins or extends
  • No color manipulation

Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/improvement)
  3. Make your changes
  4. Run the tests (cargo test)
  5. Commit your changes (git commit -am 'Add new feature')
  6. Push to the branch (git push origin feature/improvement)
  7. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.