- Install dependencies
mkdir exercise
cd exercise
brew install node
npm install dotenv octokit
-
Start VSCode and add the exercise directory to it.
-
Create .env file with GITHUB_TOKEN and GITHUB_ORG.
GITHUB_TOKEN="<TOKEN>"
GITHUB_ORG="<ORG NAME>"
-
Create repos.mjs file in VSCode.
-
Add authentication to repos.mjs:
import { Octokit } from "octokit";
import dotenv from "dotenv";
dotenv.config();
const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN,
});
-
Type
octokit.rest.
into the script, and see the available objects to use. -
Run the script:
node repos.mjs
- Enjoy coding!