git-auto-badger
Version:
A npm cli tool that reads your package.json/project metadata and git config and connects your readme with multiple badge providers (shields.io, badgen.net etc)
11 lines • 321 B
JavaScript
const fs = require('fs/promises');
const cache = new Map();
exports.readCacheFile = async function (path) {
if (cache.has(path)) {
return cache.get(path);
}
let fileContent = await fs.readFile(path);
fileContent = fileContent.toString();
cache.set(path, fileContent);
return fileContent;
}