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

@promptnroll/dotfig

v0.1.1

Published

One config to rule them all — generate ESLint, Prettier, TypeScript, EditorConfig from a single dotfig.yml

Readme

dotfig

一个配置统治一切 — 通过 dotfig.yml 自动生成 ESLint、Prettier、TypeScript、EditorConfig

English | 한국어 | 日本語

为什么选择 dotfig?

每个新项目都需要 5-10 个配置文件:eslint.config.js.prettierrctsconfig.json.editorconfig.gitignore…… 它们共享相同的设置(缩进大小、引号、分号),但每个都使用不同的格式。

dotfig 让你在 dotfig.yml 中只定义一次偏好设置,自动生成所有配置文件。

dotfig.yml  →  eslint.config.js
             →  .prettierrc
             →  tsconfig.json
             →  .editorconfig
             →  .gitignore

安装

npm install -g dotfig

快速开始

# 交互式设置 — 创建 dotfig.yml
dotfig init

# 生成所有配置文件
dotfig sync

dotfig.yml

version: 1
preset: typescript          # typescript | react | node

rules:                      # 跨工具共享
  indent: 2                 # → prettier, editorconfig, eslint
  semicolons: false         # → prettier, eslint
  quotes: single            # → prettier, eslint
  line-width: 100           # → prettier, editorconfig, eslint

typescript:                 # tsconfig.json 选项
  strict: true
  target: ES2024
  jsx: react-jsx            # react 预设自动配置
  paths:
    "@/*": ["./src/*"]

lint:                       # 额外 ESLint 规则
  no-unused-vars: error
  no-console: warn

format:                     # 额外 Prettier 选项
  trailing-comma: all
  bracket-spacing: true

gitignore:                  # 额外 .gitignore 模式
  extra:
    - "*.local"
    - ".env"

核心原理

rules 部分是关键。只需定义一次,自动应用到所有工具:

| dotfig.yml | Prettier | ESLint | EditorConfig | |------------|----------|--------|--------------| | indent: 2 | tabWidth: 2 | indent 规则 | indent_size = 2 | | semicolons: false | semi: false | semi 规则 | — | | quotes: single | singleQuote: true | quotes 规则 | — | | line-width: 100 | printWidth: 100 | max-len 规则 | max_line_length = 100 |

生成的文件

| 输入 | 输出 | |------|------| | rules + format | .prettierrc | | rules + lint | eslint.config.js(flat config) | | rules + typescript | tsconfig.json | | rules | .editorconfig | | preset + gitignore | .gitignore |

预设

预设提供合理的默认值。dotfig.yml 中的显式值始终优先。

| 预设 | 描述 | |------|------| | typescript | 严格 TypeScript + ESM + Prettier 默认配置 | | react | TypeScript + JSX + React ESLint 插件 | | node | TypeScript + Node.js 目标 |

命令

dotfig init

交互式向导,创建 dotfig.yml

  • 选择预设(typescript / react / node)
  • 配置缩进大小、分号、引号风格、行宽

dotfig sync

读取 dotfig.yml,在当前目录生成所有配置文件。

$ dotfig sync
✓ 生成 .editorconfig
✓ 生成 .gitignore
✓ 生成 .prettierrc
✓ 生成 tsconfig.json
✓ 生成 eslint.config.js

✓ 5个配置文件已生成。

许可证

MIT