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

@confused-techie/compactignore

v2.0.3

Published

Single file configuration for your Code Exclusions.

Downloads

11

Readme

CompactIgnore

Single file configuration for your Code Exclusions.

.gitignore - .dockerignore - .prettierignore - .npmignore - .eslintignore - .gcloudignore

Codacy Badge code style: prettier codecov CI - Standards CI - Tests

CompactIgnore is a single file configuration tool aimed at helping to reduce the overhead and allow easy consistency across ignore files.

By creating a .compactignore file, it will be able to generate any supported ignore file specified with their own custom entries or inheriting others.

Installation

To start using CompactIgnore install the package, either Globally or as a Dev Dependency:

Globally:

npm install @confused-techie/compactignore -g

Dev-Dependency:

npm install @confused-techie/compactignore -D

Once installed you'll need to create you .compactignore file, more on that below, now it's time to use CompactIgnore.

To generate your ignore files the command needed will depend on your installation.

Globally:

Just run compactignore in the same directory that includes your .compactignore file.

Dev-Dependency:

If you include CompactIgnore in your package, it's recommended to add the following snippet to your package.jsons scripts.

"scripts": {
  "ignore": "compactignore"
}

Then when needed you can run npm run ignore to regenerate your ignore files.

Usage

When creating your .compactignore file it's good to know that generally all rules are based around the .gitignore file. With some notably exclusions.

CompactIgnore uses Profiles to determine what kind of ignore file to generate as well as using Profiles to separate what entries to include in each file.

The key values to remember:

  • > is a profile declarator line. This character should be followed by the profile you plan to use for this file.
  • ! means to include this file in your ignore file, similar to how this will include the file when used in a gitignore
  • # means this line is a comment. It will be included in the final ignore files
  • Having no special character in front of a line will then go ahead and exclude that line from the ignore file.
  • To escape any characters use \
  • Each entry must be on it's one line

Examples

To create the following files:

.gitignore

/node_modules
/secrets.json

.dockerignore

/node_modules
/secrets.json
.gitignore
.gitattributes

You just need to create the following .compactignore file to accomplish the same.

.compactignore

> GLOBAL
/node_modules
/secrets.json
> dockerignore
.gitignore
.gitattributes

Remember if you ever want to generate an additional ignore that includes only the GLOBAL Profile entries you can add > profile_name with no special entries and it will be generated containing only the GLOBAL Profile entries.

If you'd like, here's a more complicated example.

Profiles

The following profiles are supported:

  • GLOBAL|global: This profile will apply all entries globally to each other ignore file that is created.
  • dockerignore: This profile will generate a .dockerignore file.
  • eslintignore: This profile will generate a .eslintignore file.
  • gitignore: This profile will generate a .gitignore file.
  • npmignore: This profile will generate a .npmignore file.
  • prettierignore: This profile will generate a .prettierignore file.
  • gcloudignore: This profile will generate a .gcloudignore file.

Why use CompactIgnore

CompactIgnore is made for those developers who end up having to maintain several ignore files in a single codebase.

Say for example your project is uploaded to a Git Repository, uses Prettier to make your code readable, uses ESLint to ensure your code meets your standards, and is published to NPM.JS

If all the above is true you need to manually keep track of .gitignore, .eslintignore, .prettierignore, and .npmignore

Which in most cases can be fine if their configuration is simple, or your project doesn't contain anything that shouldn't be uploaded. But say now in your repo you add .env or secrets.json or some other file that contains sensitive configuration details or private API keys you need to double or triple check that these are added to every single file, and ensure they all work properly. But with CompactIgnore it can now be as easy as adding it to your GLOBAL Profile, and generating all your ignore files right away.

Documentation

Contribute

See CONTRIBUTING.md.