basename
Extract the final component from file paths, removing directory prefixes. Optionally strip a given suffix from each basename.
Instructions
Return the final path component, stripping all directory prefixes. Read-only, no side effects. Returns JSON with the stripped filename. Use to extract filenames from full paths. Not for extracting directory portions — use 'dirname' for the inverse operation. See also 'dirname', 'realpath'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes | Paths to transform. | |
| raw | No | Write one basename per line without a JSON envelope. | |
| suffix | No | Remove suffix from each basename when present. |