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

@fredericmarx/gitignore

v1.1.6

Published

Personal gitignore file of Frederic Marx

Downloads

1

Readme

@fredericmarx/gitignore

Node.js CI Node.js Package

When you think to yourself “Wouldn’t it be cool if I could just run npx @myname/gitignore instead of manually copying it over from my previous project every time” and then it’s suddenly 7pm.

Usage

npx @fredericmarx/gitignore

This will copy the contents of gitignore to a new .gitignore file in your current working directory.

This module is designed as a standalone CLI tool. You could install it in your project with npm install @fredericmarx/gitignore. I don’t know why you would want to do that, but who am I to tell you what to do with your life.

What’s in the .gitignore?

My .gitignore-template is based on an old, stripped-down version of GitHub’s Node .gitignore. If I run into any other conventions for log files or generated code, I will add them here as I encounter them. Most notably, this template ignores the dreaded .DS_Store files.

Things I learned making this

  • I could have had it so much easier by adding a shell command to my dotfiles that does the same thing.
  • The Node module ecosystem has become such a mess, especially if you’re just throwing together a project and copy stuff from tutorials that sometimes use ES Modules and sometimes CommonJS. I’m glad that in most of my frontend work a bundler will abstract these issues away.
  • If you want to make your package executable via npx, you need two things: a bin field in your package.json, and a shebang at the start of the file you want to execute.
  • I played around with git commit hooks for this one, and Husky made it super easy to work with them. They also do some clever things with npx in their installation process, so I naturally felt a deep kinship with them.
  • Node.js has a built-in test runner! It feels a bit clunky compared to fully-featured libraries like Jest, but I liked the idea of Using The Platform, and keeping external dependencies to a minimum. I initially decided to add tests as a joke to make this as overengineered as possible, but they actually saved me from a bug already when I had to significantly reshuffle my code due to the npm .gitignore bundling fiasco (see next point)
  • npm makes it incredibly hard to bundle a .gitignore file with your package. Not gonna lie, that was the one that really made me want to set my computer on fire 😫. See, the whole reason I started this project, the pièce de résistance, if you will, is that I wanted to create a JavaScript module that, upon execution, copies its own .gitignore file to your current working directory. After some back and forth I decided to choose the popular workaround of simply using a gitignore template (without the leading dot), which is pragmatic, but infinitely less fun.