Sha256: 86341cef07576c7bd907e67ef77188c692524e7141215da4f69ad4ae89ef96c7
Contents?: true
Size: 840 Bytes
Versions: 29
Compression:
Stored size: 840 Bytes
Contents
const { existsSync, readFileSync } = require("fs"); // This is how long to wait for the parser to spin up. For the most part, 5 // seconds is plenty of time. But in some environments, it may be necessary to // increase this value. const timeoutMs = parseInt(process.env.PRETTIER_RUBY_TIMEOUT_MS || "5000", 10); const filepath = process.argv[process.argv.length - 1]; const timeout = setTimeout(() => { clearInterval(interval); throw new Error(`Failed to get information from parse server in time. If this happens repeatedly, try increasing the PRETTIER_RUBY_TIMEOUT_MS environment variable beyond 5000.`); }, timeoutMs); const interval = setInterval(() => { if (existsSync(filepath)) { process.stdout.write(readFileSync(filepath).toString("utf8")); clearTimeout(timeout); clearInterval(interval); } }, 100);
Version data entries
29 entries across 29 versions & 2 rubygems