@inventivetalent/gitconfig
v1.0.9
Published
Load JSON configs from remote files
Downloads
58
Readme
gitconfig
Install
npm install --save @inventivetalent/gitconfig
Public Repo Example
import GitConfig from "@inventivetalent/gitconfig"
// Set source for all config files
GitConfig.source = "https://raw.githubusercontent.com/me/myrepo/master/";
// Load config.json from the source
const myConfig = await GitConfig.get("config.json");
// Invalidate changes
await myConfig.invalidate();
Private Repo Example
import GitConfig from "@inventivetalent/gitconfig"
// GitHub authorization + raw
GitConfig.axiosInstance.defaults.headers["Authorization"] = "token MyGithubToken";
GitConfig.axiosInstance.defaults.headers["Accept"] = "Application/vnd.github.v3.raw";
// Set source for all config files
GitConfig.source = "https://api.github.com/repos/me/myrepo/";
// Load config.json from the source
const myConfig = await GitConfig.get("config.json");
// Invalidate changes
await myConfig.invalidate();