# valid-filename **Repository Path**: mirrors_sindresorhus/valid-filename ## Basic Information - **Project Name**: valid-filename - **Description**: Check if a string is a valid filename - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-19 - **Last Updated**: 2026-05-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # valid-filename > Check if a string is a [valid filename](https://github.com/sindresorhus/filename-reserved-regex) ## Install ``` $ npm install valid-filename ``` ## Usage ```js import isValidFilename from 'valid-filename'; isValidFilename('foo/bar'); //=> false isValidFilename('foo-bar'); //=> true ``` ## API ### isValidFilename(input) Returns a `boolean` of whether `input` is a valid filename. #### input Type: `string` The string to check. ## Related - [filenamify](https://github.com/sindresorhus/filenamify) - Convert a string to a valid safe filename