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

nodejs-app-template

v1.7.6

Published

Node.js app template

Downloads

17

Readme

nodejs-app-template

This is a template for a Node.js TypeScript app.

The following tools and conventions have been configured:

Usage

Install dependencies

npm ci

Edit the code

You can edit the code in the "src" directory. The entry point of the application is "src/main.ts".

Run the application in development mode

npm run dev

Note: The project uses "tsx" to run TypeScript code on the fly.

Compile the application

npm run compile

This will create a "dist" directory with the compiled code.

Note: The "dist" directory will mimic the main directory structure. All directories with TypeScript files will be recreated in the "dist" directory. In the default configuration those are "src" and "test".

Run the compiled application

node ./dist/main.js

Note: This will command will fail if the application has not been compiled (no "dist" directory)!

Test the application

Native Node.js test runner is used to run the tests. Native "node:assert" and "node:test" modules are used to write the tests.

Source code-related tests are kept alongside the source code they test in the "src" directory. Other tests and test utilities are kept in the "test" directory.

To run the unit tests:

npm run test

The coverage report can be generated in the "lcov" format by running:

npm run test:experimental-coverage

After running the command, the coverage report will be available in the "lcov.info" file.

Note that the coverage report is experimental as it only works on compiled code.

Run the linter

"ESLint" is used to lint the code.

npm run eslint:check

Note: The linter will return a non-zero exit code if there are any linting errors or warnings.

You can also try to automatically fix some of the errors and warnings by running:

npm run eslint:fix

Run the formatter

"Prettier" is used to format the code.

npm run prettier:check

Formatting errors can be automatically fixed by running:

npm run prettier:fix

Commit the changes

"Conventional Commits" are used to format the commit messages.

The following types are supported:

  • "feat": A new feature;
  • "fix": A bug fix;
  • "chore": Other changes;

Use {type}!: {description} as the commit message for breaking changes.

Thanks to the "@release-it/conventional-changelog" plugin for "release-it", the changelog will be automatically generated when releasing. Also, the version number will be automatically incremented based on the commit messages.

GitHub Actions

Continuous integration

There is one CI pipeline configured in the ".github/workflows" directory:

  • "Continuous integration": This pipeline will check the integrity of the code by running formatting, linting, and testing.

Continuous delivery

There is one CD pipeline configured in the ".github/workflows" directory:

  • "Release": This pipeline will create a GitHub release, build a Docker image, and push it to a Docker registry and also push the compiled code to npm.