MCPcopy Index your code
hub / github.com/nodejs/node / existsSync

Function existsSync

lib/fs.js:318–337  ·  view source on GitHub ↗

* Synchronously tests whether or not the given path exists. * @param {string | Buffer | URL} path * @returns {boolean}

(path)

Source from the content-addressed store, hash-verified

316 * @returns {boolean}
317 */
318function existsSync(path) {
319 const h = vfsState.handlers;
320 if (h !== null) {
321 const result = h.existsSync(path);
322 if (result !== undefined) return result;
323 }
324 try {
325 path = getValidatedPath(path);
326 } catch (err) {
327 if (showExistsDeprecation && err?.code === 'ERR_INVALID_ARG_TYPE') {
328 process.emitWarning(
329 'Passing invalid argument types to fs.existsSync is deprecated', 'DeprecationWarning', 'DEP0187',
330 );
331 showExistsDeprecation = false;
332 }
333 return false;
334 }
335
336 return binding.existsSync(path);
337}
338
339function readFileAfterOpen(err, fd) {
340 const context = this.context;

Calls 1

existsSyncMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…