Skip to content

Commit 0079a2a

Browse files
Update README.md (#959)
Added table of contents as well as additional support/guidance for install, local development, configuration and more descriptions as well. Co-authored-by: Thomas Lindner <[email protected]>
1 parent 3f7e41e commit 0079a2a

File tree

1 file changed

+66
-1
lines changed

1 file changed

+66
-1
lines changed

README.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,53 @@
88
![ci](https://github.com/tclindner/npm-package-json-lint/workflows/ci/badge.svg?branch=master)
99
[![Netlify Status](https://api.netlify.com/api/v1/badges/e76a30d9-13f0-4691-a49b-454570589de2/deploy-status)](https://app.netlify.com/sites/npmpackagejsonlint/deploys)
1010

11+
- [npm-package-json-lint](#npm-package-json-lint)
12+
* [What is npm-package-json-lint?](#what-is-npm-package-json-lint-)
13+
* [Install and Use](#install-and-use)
14+
+ [System Dependencies](#system-dependencies)
15+
- [Node](#node)
16+
+ [Use the cli](#use-the-cli)
17+
- [Use cli globally](#use-cli-globally)
18+
- [Use cli in project](#use-cli-in-project)
19+
- [Using the linter](#using-the-linter)
20+
* [From the command line](#from-the-command-line)
21+
* [In the program](#in-the-program)
22+
* [Custom Configuration](#custom-configuration)
23+
* [Local Development](#local-development)
24+
* [Documentation](#documentation)
25+
* [Migrating from v5.x.x to 6.x.x](#migrating-from-v5xx-to-6xx)
26+
* [Migrating from v4.x.x to 5.x.x](#migrating-from-v4xx-to-5xx)
27+
* [Migrating from v3.x.x to 4.x.x](#migrating-from-v3xx-to-4xx)
28+
* [Migrating from v2.x.x to 3.x.x](#migrating-from-v2xx-to-3xx)
29+
* [Migrating from v1.x.x to 2.x.x](#migrating-from-v1xx-to-2xx)
30+
* [Migrating from v0.x.x to 1.x.x](#migrating-from-v0xx-to-1xx)
31+
* [Contributing](#contributing)
32+
* [Release History](#release-history)
33+
* [Related](#related)
34+
* [License](#license)
1135

1236
## What is npm-package-json-lint?
1337

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

1744
* validity of data types in nodes. Ex: `name` should always be a string.
1845
* whether a string is a lowercase
1946
* whether a version number is a valid
2047
* the presence of a given module
2148
* the presence of a pre-release version of a module
49+
* the presence of an author
50+
* the presence of any bugs
51+
* valid dependencies
52+
* valid licenses
2253
* and much more!
2354

2455
Please see the [website](https://npmpackagejsonlint.org/docs/rules) for a list of rules.
2556

26-
## How do I install it?
57+
## Install and Use
2758

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

@@ -44,6 +75,40 @@ First thing first, let's make sure you have the necessary pre-requisites.
4475

4576
* `npm install npm-package-json-lint`
4677

78+
#### Using the linter
79+
80+
##### From the command line
81+
82+
* Once npm-package-json-lint is installed either in the project or globally it can be run with the
83+
following command, `npx npm-package-json-lint`. This will go through the process of linting/validating
84+
your code to meet your desired specifications.
85+
86+
##### In the program
87+
88+
* The linter can also be used as a module in the program and the output be displayed via a log message.
89+
Adding the following code to your file can accomplish this.
90+
91+
```
92+
const npmPackageJsonLint = require("npm-package-json-lint");
93+
const result = npmPackageJsonLint.lintFiles(["package.json"]);
94+
console.log(result);
95+
```
96+
97+
## Custom Configuration
98+
99+
npm-package-json-lint has the ability to be constomly configured to match your desires.
100+
To configure the linter navigate to the .npmpackagejsonlintrc file in the repository and add
101+
in or remove your desired rules.
102+
103+
## Local Development
104+
Follow these steps to get your local environement set up to allow you to contribute to the repository
105+
106+
1. In the terminal, navigate to the directory in which you want the repository to be cloned.
107+
2. Run this command from the terminal, `git clone https://github.com/tclindner/npm-package-json-lint.git`
108+
3. After cloning the repository navigate into the project's root directory from the terminal.
109+
4. Run "npm install" to install the necessary dependencies.
110+
5. Your local environment is now set up to create PR's and work on different issues
111+
47112
## Documentation
48113

49114
[Website](https://npmpackagejsonlint.org)

0 commit comments

Comments
 (0)