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

Function lstat

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

Source from the content-addressed store, hash-verified

1782}
1783
1784async function lstat(path, options = { __proto__: null, bigint: false }) {
1785 const h = vfsState.handlers;
1786 if (h !== null) {
1787 const promise = h.lstat(path, options);
1788 if (promise !== undefined) return await promise;
1789 }
1790 path = getValidatedPath(path);
1791 if (permission.isEnabled() && !permission.has('fs.read', path)) {
1792 const resource = pathModule.toNamespacedPath(BufferIsBuffer(path) ? BufferToString(path) : path);
1793 throw new ERR_ACCESS_DENIED('Access to this API has been restricted', 'FileSystemRead', resource);
1794 }
1795 const result = await PromisePrototypeThen(
1796 binding.lstat(path, options.bigint, kUsePromises),
1797 undefined,
1798 handleErrorFromBinding,
1799 );
1800 return getStatsFromBinding(result);
1801}
1802
1803async function stat(path, options = { __proto__: null, bigint: false, throwIfNoEntry: true }) {
1804 const h = vfsState.handlers;

Callers 3

getDirentFunction · 0.70
_rimrafFunction · 0.70
getStatsFunction · 0.50

Calls 4

getStatsFromBindingFunction · 0.85
isEnabledMethod · 0.80
hasMethod · 0.65
lstatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…