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

@1-/format

v0.1.0

Published

Lightweight modular code formatter for JavaScript, Stylus, and SVG with language-specific processors

Downloads

44

Readme

English | 中文


@1-/format : Lightweight modular code formatter for JavaScript, Stylus, and SVG

Functionality

Format code consistently across multiple languages using language-specific processors. Supports:

  • JavaScript: AST-based formatting with custom rules (read, readAsync, sleep, constMerge, while, utf8e, env)
  • Stylus: Parser-driven formatting using @1-/stylus
  • SVG: SVGO-based minification with custom plugin configuration

Usage demonstration

Install globally:

npm install -g @1-/format

Format files:

format file.js file.styl image.svg

Or use as a module:

import format from '@1-/format';

const formatted = await format('path/to/file.js');

Design philosophy

The formatter follows a strict dispatcher architecture where file extension determines processor selection. Each processor operates independently with language-specific tooling, enabling precise control without cross-language interference.

Technology stack

  • Runtime: Node.js with ES modules
  • JavaScript: yuku-parser + oxfmt + custom rules
  • Stylus: @1-/stylus parser and formatter
  • SVG: SVGO with custom preset configuration
  • CLI: yargs
  • Utilities: @3-/read, @3-/write, @3-/log

Code structure

src/
├── _.js          # Main dispatcher routing by file extension
├── bin.js        # CLI executable with yargs integration
├── js.js         # JavaScript formatter delegating to @1-/fix
├── styl.js       # Stylus formatter using @1-/stylus
└── svg.js        # SVG formatter using @3-/svgo

Historical context

Code formatting evolved from simple text transformations to AST-based tools. @1-/format represents the modern micro-architecture approach: small, focused libraries composed together rather than monolithic solutions. This enables targeted improvements and avoids the complexity bloat of universal formatters.

About

This library is developed by WebC.site.

WebC.site: A new paradigm of web development for AI


@1-/format : 轻量级模块化代码格式化工具,支持 JavaScript、Stylus 和 SVG

功能介绍

使用语言特定处理器一致地格式化多种语言代码。支持:

  • JavaScript:基于 AST 的格式化,包含自定义规则(read、readAsync、sleep、constMerge、while、utf8e、env)
  • Stylus:解析器驱动的格式化,使用 @1-/stylus
  • SVG:基于 SVGO 的压缩,采用自定义插件配置

使用演示

全局安装:

npm install -g @1-/format

格式化文件:

format file.js file.styl image.svg

或作为模块使用:

import format from '@1-/format';

const formatted = await format('path/to/file.js');

设计思路

格式化器采用严格的分发器架构,文件扩展名决定处理器选择。每个处理器独立运行,使用语言特定工具,实现精确控制且避免跨语言干扰。

技术栈

  • 运行时:Node.js ES 模块
  • JavaScript:yuku-parser + oxfmt + 自定义规则
  • Stylus:@1-/stylus 解析器和格式化器
  • SVG:SVGO 与自定义预设配置
  • CLI:yargs
  • 工具库:@3-/read、@3-/write、@3-/log

代码结构

src/
├── _.js          # 主分发器,按文件扩展名路由
├── bin.js        # CLI 可执行文件,集成 yargs
├── js.js         # JavaScript 格式化器,委托给 @1-/fix
├── styl.js       # Stylus 格式化器,使用 @1-/stylus
└── svg.js        # SVG 格式化器,使用 @3-/svgo

历史故事

代码格式化从简单的文本转换发展为基于 AST 的工具。@1-/format 代表现代微架构方法:小型、专注的库组合使用,而非单体解决方案。这种方法支持针对性改进,避免通用格式化器的复杂性膨胀。

关于

本库由 WebC.site 开发。

WebC.site : 面向人工智能的网站开发新范式