Simple way to add file with Node JS.
npm i push-only
import push_only from "push-only";
async function run() {
let result = await push_only({
token: "your_github_token",
repo: "user/repo",
filename: "filename.txt",
content: "content_in_base64",
});
console.log(result); // return "filename.txt" after success
}
run();
export default defineConfig({
resolve: {
alias: {
"node-fetch": "isomorphic-fetch",
},
},
});