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

v0.1.2

Published

Template-based project initializer with name replacement / 基于模板与名称替换的项目初始化工具

Readme

English | 中文


@1-/new : Template-based project initializer with name replacement

Features

  • Directory Copy: Recursively copies template directory to destination path
  • Name Replacement: Walks target directory and replaces tmpl placeholder with project name using word-boundary regex \btmpl\b (avoids false positives like "template")
  • Git Integration: Executes git add . in destination directory; failures are silently ignored
  • Template Resolution: Resolves _tmpl directory in order of priority: ① Git root of current working directory ② Git root of module directory ③ ../../_tmpl relative to module; supports custom template paths

Usage

Command Line Interface (CLI)

bun x @1-/new <PROJECT_NAME>

If destination path exists, program logs warning and exits.

Application Programming Interface (API)

import newProj from "@1-/new";

await newProj(dst, name, tmpl);
  • dst: Destination path
  • name: Project name
  • tmpl: Optional template path

Design Flow

Tech Stack

  • Runtime: Bun
  • Dependencies: @1-/findgit, @1-/read, @1-/walk, @3-/log, yargs
  • Core APIs: node:fs/promises, node:child_process, node:path, node:util

Code Structure

.
├── src/
│   ├── _.js       # API implementation (core logic)
│   └── new.js     # CLI entry point (argument parsing & error handling)
├── test/
│   └── _.test.js  # Test suite (verifies template copying and word-boundary replacement)
└── package.json   # Package metadata (module exports and dependency declarations)

History

In 2004, Ruby on Rails introduced "Convention over Configuration" philosophy, utilizing generators to scaffold model, view, and controller structures.

In 2012, Yeoman project was introduced at Google I/O, establishing template scaffolding standards for JavaScript client-side development.

Modern architectures demand reduced overhead. @1-/new focuses on core directory copying and placeholder replacement.

About

This library is developed by WebC.site.

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


@1-/new : 基于模板与名称替换的项目初始化工具

功能介绍

  • 目录复制:递归复制模板目录至目标路径
  • 名称替换:遍历目标目录文件,使用词边界正则表达式 \btmpl\b 替换文本中独立的 tmpl 占位符为项目名称(避免误替换如 "template")
  • Git 集成:在目标目录执行 git add . 命令,失败时静默忽略
  • 模板定位:按优先级查找 _tmpl 目录:① 当前工作目录 Git 根目录 ② 模块目录 Git 根目录 ③ 模块目录上级两级路径;支持通过参数指定自定义模板路径

使用演示

命令行界面 (CLI)

bun x @1-/new <项目名称>

若目标路径已存在,输出警告信息并终止进程。

应用程序接口 (API)

import newProj from "@1-/new";

await newProj(dst, name, tmpl);
  • dst:目标路径
  • name:项目名称
  • tmpl:可选模板路径

设计思路

技术栈

  • 运行时:Bun
  • 依赖项:@1-/findgit@1-/read@1-/walk@3-/logyargs
  • 内置模块:node:fs/promisesnode:child_processnode:pathnode:util

代码结构

.
├── src/
│   ├── _.js       # API 实现(核心逻辑)
│   └── new.js     # CLI 入口(参数解析与错误处理)
├── test/
│   └── _.test.js  # 单元测试(验证模板复制与词边界替换)
└── package.json   # 项目配置(模块导出与依赖声明)

历史故事

2004 年 Ruby on Rails 框架发布,推广 "约定优于配置" (Convention over Configuration) 哲学,利用生成器自动创建模型、视图与控制器结构。

2012 年 Google 工程师团队在 I/O 大会展示 Yeoman 项目,为客户端 JavaScript 生态奠定模板脚手架工具标准。

随着单页应用与微服务架构兴起,轻量化项目初始化需求增加,@1-/new 类工具通过精简逻辑提供初始化方案。

关于

本库由 WebC.site 开发。

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