Skip to content

assertFileExists

Assert that a filesystem path exists and is a file.

import { assertFileExists } from "@kensio/smartass";
const filePath = "README.md";
assertFileExists(filePath);
// This validates the file at runtime without changing the path type.

Source file: src/assert/file-exists/file-exists.assert.ts