Node.js Core Utilities
CLI tools for Node.js Core collaborators.
Usage
npm install -g node-core-utils
After running any of the tools for the first-time, you will be asked to provide a
GitHub username and password in order to create a personal access token.
If you prefer not to provide your login credentials, follow these instructions
to create the token.
Note: We need to read the email of the PR author in order to check if it matches
the email of the commit author. This requires checking the box user:email
when
you create the personal access token (you can edit the permission later as well).
Then create a file named .ncurc
under your $HOME
directory (~/.ncurc
);
{
"username": "you_github_username",
"token": "token_that_you_created"
}
If you would prefer to build from the source, install and link:
git clone git@github.com:joyeecheung/node-core-utils.git
cd node-core-utils
npm install
npm link
get-metadata
This one is inspired by Evan Lucas's node-review
, although it is a CLI implemented with the Github GraphQL API.
get-metadata <identifier>
Retrieves metadata for a PR and validates them against nodejs/node PR rules
Options:
--version Show version number [boolean]
--owner, -o GitHub owner of the PR repository [string]
--repo, -r GitHub repository of the PR [string]
--file, -f File to write the metadata in [string]
--help, -h Show help [boolean]
Examples:
PRID=12345
$ get-metadata $PRID
$ get-metadata https://github.com/nodejs/node/pull/$PRID
$ get-metadata $PRID -o nodejs -r node
$ get-metadata $PRID > msg.txt
$ get-metadata $PRID -f msg.txt
$ echo -e "$(git show -s --format=%B)\n\n$(cat msg.txt)" > msg.txt
$ git commit --amend -F msg.txt
Features
Contributing
See CONTRIBUTING.md.
License
MIT. See LICENSE.