MCPcopy
hub / github.com/serverless/serverless / fileExists

Function fileExists

packages/sf-core/src/utils/fs/index.js:25–32  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

23 * @returns A promise that resolves to true if the file exists and is a regular file, false otherwise.
24 */
25const fileExists = async (filePath) => {
26 try {
27 const stats = await fsp.lstat(filePath)
28 return stats.isFile()
29 } catch (e) {
30 return false
31 }
32}
33
34/**
35 * Checks if a directory exists at the given path.

Callers 6

commandSupportFunction · 0.90
saveMetaFunction · 0.90
renameTemplateInAllFilesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…