How to use read-cache - 2 common examples

To help you get started, we’ve selected a few read-cache examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sebastian-software / postcss-smart-import / src / load-content.js View on Github external
export default function loadContent(fileName) {
  return readCache(fileName, "utf-8")
}
github TrySound / postcss-inline-svg / src / lib / load-svg.js View on Github external
export default function loadSVG(id, data, opts) {
    return readCache(id, 'utf-8').then(result => {
        let code = applyData(result, data);
        if (opts.encode) {
            code = opts.encode(code);
        }
        return opts.transform(code, id);
    });
}

read-cache

Reads and caches the entire contents of a file until it is modified

MIT
Latest version published 9 years ago

Package Health Score

65 / 100
Full package analysis

Popular read-cache functions