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

Function stat

lib/internal/fs/promises.js:1803–1819  ·  view source on GitHub ↗
(path, options = { __proto__: null, bigint: false, throwIfNoEntry: true })

Source from the content-addressed store, hash-verified

1801}
1802
1803async function stat(path, options = { __proto__: null, bigint: false, throwIfNoEntry: true }) {
1804 const h = vfsState.handlers;
1805 if (h !== null) {
1806 const promise = h.stat(path, options);
1807 if (promise !== undefined) return await promise;
1808 }
1809 const result = await PromisePrototypeThen(
1810 binding.stat(getValidatedPath(path), options.bigint, kUsePromises, options.throwIfNoEntry),
1811 undefined,
1812 handleErrorFromBinding,
1813 );
1814
1815 // Binding will resolve undefined if UV_ENOENT or UV_ENOTDIR and throwIfNoEntry is false
1816 if (!options.throwIfNoEntry && result === undefined) return undefined;
1817
1818 return getStatsFromBinding(result);
1819}
1820
1821async function statfs(path, options = { __proto__: null, bigint: false }) {
1822 const h = vfsState.handlers;

Callers 9

followStatMethod · 0.70
symlinkFunction · 0.70
fixWinEPERMFunction · 0.70
getStatsFunction · 0.50
pathExistsFunction · 0.50
checkParentPathsFunction · 0.50
setDestTimestampsFunction · 0.50
onLinkFunction · 0.50

Calls 2

getStatsFromBindingFunction · 0.85
statMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…