Skip to content

Infers All Contributors settings from an existing README.md table. πŸ”„

License

Notifications You must be signed in to change notification settings

JoshuaKGoldberg/all-contributors-inferred

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

56 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

All Contributors Inferred

Infers All Contributors settings from an existing README.md table and package.json. πŸ’—

πŸ‘ͺ All Contributors: 1 🀝 Code of Conduct: Kept πŸ§ͺ Coverage πŸ“ License: MIT πŸ“¦ npm version πŸ’ͺ TypeScript: Strict

Usage

Use this package's exported inferAllContributors function to infer .all-contributorsrc configuration options from package.json and README.md contents.

npm i all-contributors-inferred
import { inferAllContributors } from "all-contributors-inferred";
import fs from "node:fs/promises";

inferAllContributors({
	packageJson: JSON.parse((await fs.readFile("package.json")).toString()),
	readmeMd: (await fs.readFile("README.md")).toString(),
});
/*
[
	{
		"contributors": ...,
		"projectName": ...,
		"projectOwner": ...
	}
]
*/

Options

inferAllContributors takes in a required options object. It may have the following required properties:

  • packageJson: Data from a parsed package.json file
  • readmeMd: Text read from the README.md file

Return Type

The returned value is the same shape as you'd see in .all-contributorsrc configuration options, but with everything optional. See the exported InferredAllContributors type.

Why?

All Contributors is one of many great pieces of tooling available for repositories. Repositories that use many tools often end up with a dauntingly large number of configuration files -- over a dozen in many cases.

Many users find it exhausting and overwhelming to open a new repository with many config files. Reducing the number of config files in repositories can help make developing them more approachable.

πŸ’‘ Wish this was built into All Contributors? Lend a πŸ‘ to all-contributors/all-contributors#808 Make the .all-contributorsrc file optional (infer contributors from README.md)!

Development

See .github/CONTRIBUTING.md, then .github/DEVELOPMENT.md. Thanks! πŸ’–

Contributors

Josh Goldberg
Josh Goldberg

πŸ› πŸ’» 🚧 πŸ‘€ πŸ”§ πŸ“– πŸš‡ ⚠️ πŸ€”

πŸ’ This package was templated with create-typescript-app using the create engine.

About

Infers All Contributors settings from an existing README.md table. πŸ”„

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks