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

@mkvlrn/ts-new

v24.6.11

Published

A very opinionated cli tool for setting up a typescript project without frameworks/libs or using nest, vite, or next

Downloads

2,567

Readme

@mkvlrn/ts-new

This is a very VERY VERY opinionated CLI tool for the setup of a TypeScript project in pure Node.js, NestJS, Vite (for a React SPA), and Next.js, with a focus on code quality and consistency.

It attempts to provide a minimalistic setup with modern tools and practices without bloat - but bloat means different things to different people, so your mileage may vary.

requirements

  • Node.js 20+ - don't use anything lower than that, it's 2024
  • npm 10+ (npx should be used to run the CLI tool, but you can pick any package manager you want for the project itself)
  • Git - you should have it installed, if not, you're doing it wrong
  • A unix-like shell - if you're on Windows, you should use WSL2 or Git Bash

usage

Usage is as follows: npx --yes @mkvlrn/ts-new@latest. The CLI is interactive.

The --yes flag is used to skip the npx confirmation prompt, and the @latest tag is used to ensure you are always getting the latest version of the tool.

tools and configurations

Each project will be an ESM (type: module) project with the following tools and configurations:

  • editorconfig to maintain consistent coding styles between different editors and IDEs
  • git with a standard .gitignore file
  • prettier with a opinionated configuration on top of editorconfig
  • eslint with a few plugins and a configuration that aims to be somewhat strict without being too annoying; based on the recommended eslint rules for typescript and the awesome unicorn rules
  • vitest as a test runner, because Jest is terrible
  • lint-staged to glue together the other tools that need to run on staged files
  • husky to run the lint-staged commands on pre-commit hooks
  • commitlint to enforce conventional commit messages
  • swc as a TypeScript compiler and dev runner, because it's fast

another cli, huh?

Each available CLI out there brings some opinions and tools that might not be what you want or need, and this one is no different. The main difference is that this one is my opinion, and I'm sharing it with you.

Instead of using create-vite, @nestjs/cli, or create-next-app tools to initialize those projects, this CLI tool will do it from scratch, adding only the tools and configurations that I think are necessary for a good starting point (see above).

NestJs and Next.js have their own way of doing things, and both of them are okay, but I think they can be improved. Also they seem to be very resistant to moving to ESM, and that's a shame.

no huge readme with exhaustive explanations

Just generate a project and see for yourself. If you have any questions, feel free to open an issue or a PR.

The defaults are opinionated, but very sane and easy to adapt to your needs.