MCPcopy Create free account
hub / github.com/webpack/stylus-loader / readFile

Function readFile

src/utils.js:348–358  ·  view source on GitHub ↗

* @param {LoaderContext["fs"]} inputFileSystem input file system * @param {string} filepath file path * @returns {Promise } file contents

(inputFileSystem, filepath)

Source from the content-addressed store, hash-verified

346 * @returns {Promise<Buffer>} file contents
347 */
348function readFile(inputFileSystem, filepath) {
349 return new Promise((resolve, reject) => {
350 inputFileSystem.readFile(filepath, (error, stats) => {
351 if (error) {
352 reject(error);
353 }
354
355 resolve(/** @type {Buffer} */ (stats));
356 });
357 });
358}
359
360const URL_RE = /^(?:url\s*\(\s*)?['"]?(?:[#/]|(?:https?:)?\/\/)/i;
361

Callers 3

stylusLoaderFunction · 0.90
getDependenciesFunction · 0.85
createEvaluatorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…