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-/upsert_gitignore

v0.1.7

Published

Safely and idempotently update .gitignore / 安全幂等地更新 .gitignore

Downloads

934

Readme

English | 中文


@1-/upsert_gitignore : Safely and idempotently update .gitignore rules

⚠️ Note: This document is static Markdown. All JavaScript examples are for illustration only and are NOT executed in this project.

Design思路

  • Start └─ Check: does file exist? ├─ No → Create parent directories → Write initial rules → End └─ Yes → Read file content → Split into lines → Trim & filter → Check rules exist? ├─ Yes → End └─ No → Append new rules → Join with newlines → Write updated content → End

Technology stack

  • Runtime: Bun / Node.js
  • Core dependencies: @3-/txt_li, @3-/write, @3-/read
  • License: MulanPSL-2.0

Code structure

src/
└── _.js      # Core implementation
tests/
└── _.test.js # Unit tests

Historical context

Git introduced .gitignore in 2005 as part of its initial release. Early workflows used manual editing or fragile shell scripts like echo "node_modules" >> .gitignore.

The rise of CI/CD pipelines and project scaffolding tools created demand for deterministic configuration management. This library implements the idempotent pattern to ensure consistent state regardless of execution frequency.

Idempotence is essential for infrastructure-as-code systems where configuration must converge to desired state without side effects from repeated application.

About

This library is developed by WebC.site.

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


@1-/upsert_gitignore : 安全幂等更新 .gitignore 规则

⚠️ 注意:本文档为静态 Markdown,所有 JavaScript 示例仅作说明,不在此项目中执行。

设计思路

  • 开始 └─ 检查:文件是否存在? ├─ 否 → 创建父级目录 → 写入初始规则 → 结束 └─ 是 → 读取文件内容 → 按行切分 → 去除空格并过滤空行 → 检查规则是否已存在? ├─ 是 → 结束 └─ 否 → 追加新规则 → 换行符拼接 → 写入更新后内容 → 结束

技术栈

  • 运行环境:Bun / Node.js
  • 核心依赖:@3-/txt_li@3-/write@3-/read
  • 许可证:MulanPSL-2.0

代码结构

src/
└── _.js      # 核心实现
tests/
└── _.test.js # 单元测试

历史故事

Git 于 2005 年随初始版本发布引入 .gitignore。早期工作流依赖手动编辑或脆弱的 Shell 脚本,如 echo "node_modules" >> .gitignore

CI/CD 流水线和项目脚手架工具的普及催生了确定性配置管理需求。本库实现幂等模式,确保执行频率不影响最终状态。

幂等性是基础设施即代码系统的关键特性,配置必须收敛至期望状态且无重复应用副作用。

关于

本库由 WebC.site 开发。

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