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 🙏

© 2024 – Pkg Stats / Ryan Hefner

create-program

v1.0.0

Published

This is a scaffolding tool to create a simple [Node.js](https://nodejs.org/en) program written in [TypeScript](https://www.typescriptlang.org/), utilizing [ECMAScript Modules](https://nodejs.org/api/esm.html) (ESM) and using [Jest](https://jestjs.io/) as

Downloads

6

Readme

create-program

This is a scaffolding tool to create a simple Node.js program written in TypeScript, utilizing ECMAScript Modules (ESM) and using Jest as a test suite. The tool came out of my own frustration with setting all this up, and can be used for starting up simple command-line apps, or any Node.js app really.

(A "program" is what we used to call "apps" back in the day. And yeah, create-app was taken.)

Usage

Create a directory for your project and run the following command in it:

npm create program

You can also specify the directory where it will be created.

npm create program --path ~/code/my-new-project

It will use the directory name as the project name, but you can specify a different name with the --name option.

npm create program --name name-of-my-new-project

For other options, run:

npm create program --help

Alternative approaches

  • The Node.js documentation has a getting started page for how to set up a TypeScript project. There they mention the usage of the --loader flag, like node --loader=ts-node/esm example.ts, I have a working example here – however, this prints a nasty warning that this flag is experimental and might be removed in the future. Instead, there is an --import flag that should be used. This is being discussed in this issue. I have a working example of how to get this variant working here.

    I am not sure if this kind of approach is really worth it, and the ts-node project seems to not be very actively maintained.

  • node-typescript-boilerplate is a nice and updated boilerplate project, which I took some inspiration from.

  • Using TypeScript Node.js with native ESM is a good reference guide on how things should be set up.

  • Other "project starter" kind of things are here.

  • I have understood that other JavaScript runtimes like Deno and Bun simplify a lot of this process, if you don't have the requirement of sticking with Node.js.

  • Obviously, there are many "starter" kind of projects for more full fledged applications using a particular framework, like create-react-app (which I think is pretty much abandoned, though), create-next-app, create-vite and so on. For CLI apps, you can also try oclif.