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

@ilyeshdz/ts-create

v0.4.0

Published

type safe project scaffolding

Readme

@ilyeshdz/ts-create

Open on npmx.dev Open on npmx.dev Open on npmx.dev

Type safe project scaffolding. Define prompts, generate files, run commands, all with full type inference from end to end. Built on ts-treegen v1.

Install

npm install @ilyeshdz/ts-create

Quick start

import { generator, text, confirm, select, packageJson } from "@ilyeshdz/ts-create";
import { file, dir } from "ts-treegen";

await generator({ name: "my-app" })
  .prompt(text("name", "Project name", { default: "my-app" }))
  .prompt(confirm("typescript", "Use TypeScript?", { default: true }))
  .prompt(select("pkg", "Package manager", ["pnpm", "npm", "yarn"] as const))
  .render(({ answers }) =>
    dir(".", [
      answers.typescript && file("tsconfig.json", "{ /* ... */ }"),
      file("package.json", packageJson({ name: answers.name, devDependencies: ["typescript"] })),
      file("README.md", `# ${answers.name}`),
    ]),
  )
  .cmd(({ answers }) => `${answers.pkg} install`)
  .cmd("git init")
  .run();

answers is fully inferred: { name: string; typescript: boolean; pkg: "pnpm" | "npm" | "yarn" }. Conditional prompts become T | undefined.

API

generator({ name })

Start a builder chain.

.prompt(action, opts?)

Accumulate a prompt. Pass { when: (answers) => boolean } to make it conditional.

text("id", "Question?", { default: "value" })          // -> string
confirm("id", "Question?", { default: true })            // -> boolean
select("id", "Question?", ["a", "b"] as const)           // -> "a" | "b"
multiselect("id", "Question?", ["a", "b", "c"] as const) // -> ("a" | "b" | "c")[]

.render(fn)

Attach file generation. Receives { answers }. Return file(), dir(), or packageJson() nodes from ts-treegen.

.cmd(command, opts?)

Register a post generation shell command.

.cmd("npm install")
.cmd(({ answers }) => `${answers.pkg} install`)
.cmd("npm install", { cwd: ({ answers }) => `./${answers.dir}` })

.run(opts?)

Execute prompts, render, write files, and run commands. After completion, prints a summary with write and skip counts.

.run()
.run({ dryRun: true })
.run({ targetDir: "./output" })
.run({ overwrite: false })                              // skip existing files
.run({ onSuccess: ({ answers }) => {} })
.run({ onError: ({ error, command }) => "continue" })   // skip failed command

When a command fails, the default behavior is to throw and abort. Pass onError returning 'continue' to skip the failed command and proceed to the next one.

packageJson(config)

Declare package.json with auto resolved dependency versions. String deps resolve to latest from the npm registry. Use { name, version } to pin.

packageJson({
  name: "my-app",
  dependencies: ["express"],
  devDependencies: [{ name: "typescript", version: "5.7" }],
})

CLI

Reverse engineer any project folder into a reusable generator.

npx ts-create <source-folder> [output-dir] [options]
ts-create ./my-project ./scaffolds

| Option | Description | |--------|-------------| | --lockfiles <list> | Comma separated lockfiles to ignore (default: pnpm-lock.yaml,yarn.lock,package-lock.json,bun.lock,bun.lockb,deno.lock) | | --skip-hidden | Skip dotfiles and dot directories |

License

MIT