/

For the complete documentation index, see llms.txt. This page is also available as Markdown.

On this page

File name

The .filename {path} {extension?} docs ↗ function returns the file name from a given file path. The optional extension boolean parameter controls whether the file extension is included in the result.

The path parameter can be either a path relative to the main source file’s location or an absolute path. Use a slash (/) as the path separator, regardless of the operating system.

Example 1

.filename {assets/point.ts} extension:{no}

point

This can be particularly useful when combined with .listfiles.