Node API? (original) (raw)

Is your feature request related to a problem? Please describe.

I've started running npx all-contributors add as part of scripts in a few places that automate contributor attribution (https://github.com/JoshuaKGoldberg/all-contributors-auto-action, JoshuaKGoldberg/create-typescript-app#639). Right now those tools generally use https://github.com/sindresorhus/execa to run the CLI as part of Node scripts. That works, but has a couple of drawbacks:

Describe the solution you'd like

Could there be a Node package that exports an async function or two? Vaguely...

import { addContributor, addContributors } from "all-contributors";

await addContributor("MyName", ["bug", "tool"]);

await addContributors({ MyName: ["bug", "tool"], OtherName: ["design"], });

Describe alternatives you've considered

🤷 Can't think of anything else.

Additional context

Reusing the all-contributors package name feels like a good idea.