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

npm-package-json-lint

v8.0.0

Published

Configurable linter for package.json files.

Downloads

640,400

Readme

npm-package-json-lint

A package.json linter for Node projects

license npm ci Netlify Status

What is npm-package-json-lint?

npm-package-json-lint helps enforce standards for your package.json file. This helps to ensure that your files are of the highest standard and quality. It is also customisable to match your specific project guidline requirements/desires. It has support for both command line and programmatic usage. Currently it can check for:

  • validity of data types in nodes. Ex: name should always be a string.
  • whether a string is a lowercase
  • whether a version number is a valid
  • the presence of a given module
  • the presence of a pre-release version of a module
  • the presence of an author
  • the presence of any bugs
  • valid dependencies
  • valid licenses
  • and much more!

Please see the website for a list of rules.

Install and Use

First thing first, let's make sure you have the necessary pre-requisites.

System Dependencies

Node

Use the cli

Use cli globally

  • npm install npm-package-json-lint -g

Use cli in project

  • npm install npm-package-json-lint

Using the linter

From the command line
  • Once npm-package-json-lint is installed either in the project or globally it can be run with the following command, npx npm-package-json-lint. This will go through the process of linting/validating your code to meet your desired specifications.
In the program
  • The linter can also be used as a module in the program and the output be displayed via a log message. Adding the following code to your file can accomplish this.

    const npmPackageJsonLint = require("npm-package-json-lint");
    const result = npmPackageJsonLint.lintFiles(["package.json"]);
    console.log(result);

Custom Configuration

npm-package-json-lint has the ability to be constomly configured to match your desires. To configure the linter navigate to the .npmpackagejsonlintrc file in the repository and add in or remove your desired rules.

Local Development

Follow these steps to get your local environement set up to allow you to contribute to the repository

  1. In the terminal, navigate to the directory in which you want the repository to be cloned.
  2. Run this command from the terminal, git clone https://github.com/tclindner/npm-package-json-lint.git
  3. After cloning the repository navigate into the project's root directory from the terminal.
  4. Run "npm install" to install the necessary dependencies.
  5. Your local environment is now set up to create PR's and work on different issues

Documentation

Website

Quick links

CLI commands and configuration | Node.js API | Integrations

Migrating from v6.x.x to 7.x.x

Please see the migration guide.

Migrating from v5.x.x to 6.x.x

Please see the migration guide.

Migrating from v4.x.x to 5.x.x

Please see the migration guide.

Migrating from v3.x.x to 4.x.x

Please see the migration guide.

Migrating from v2.x.x to 3.x.x

Please see the migration guide.

Migrating from v1.x.x to 2.x.x

Please see the migration guide.

Migrating from v0.x.x to 1.x.x

Please see the migration guide.

Contributing

Please see CONTRIBUTING.md.

Release History

Please see CHANGELOG.md.

Related

License

Copyright (c) 2016-2023 Thomas Lindner. Licensed under the MIT license.