This is the documentation for https://api-docs.npmjs.com/. Do you want to contribute a change? Great!
Read through our contributing guidelines below to get started.
Ready to contribute to the npm API documentation? Here's how to get started:
- Install dependencies:
npm install - Update the documentation - it's OpenAPI YAML format - in the
api/directory:- Main OpenAPI spec:
api/base.yaml - Registry-specific endpoints:
api/registry.npmjs.com/
- Main OpenAPI spec:
- Test your changes:
npm run build(generatesindex.htmlandopenapi.yaml) - Review your changes: Inspect the generated
html/index.htmlfile in your browser or check theopenapi.yamlfile for your changes - Fix any issues:
npm run lintfix:yamlfor YAML formatting - Submit your PR: Commit your changes and open a pull request at https://github.com/npm/api-documentation
All interactions in the npm organization on GitHub are considered to be covered by our standard Code of Conduct.
Before submitting a new bug report please search for an existing or similar report.
Use one of our existing issue templates if you believe you've come across a unique problem.
Duplicate issues, or issues that don't use one of our templates may get closed without a response.
We use Conventional Commits.
When opening a pull request please be sure that either the pull request title, or each commit in the pull request, has one of the following prefixes:
feat: For when introducing a new feature, such as a new subdomain.fix: For bug fixes.docs: For documentation updates.chore: For changes that do not affect the published page. Often these are changes to deployment workflows.
This project validates both YAML documentation and JavaScript code. To check for linting errors, run:
npm run generate && npm run validateThis will:
- Generate the merged OpenAPI specification from source files
- Validate the OpenAPI specification using Redocly CLI
For fixing linting errors:
- YAML/Documentation errors: Run
npm run lintfix:yaml(uses Prettier for formatting) - JavaScript errors: Run
npm run lintfix:js(uses ESLint auto-fix)
Please make sure all linting passes before submitting a PR.
It should be noted that our team does not accept third-party dependency updates/PRs. If you submit a PR trying to update our dependencies we will close it with or without a reference to these contribution guidelines.
Our core team is responsible for the maintenance of the tooling/automation in this project and we ask contributors to not make changes to these when contributing (e.g. .github/*, .eslintrc.json, .licensee.json). Most of those files also have a header at the top to remind folks they are automatically generated. Pull requests that alter these will not be accepted.