astro-ghostcms/.pnpm-store/v3/files/86/e954dc5c8e7f38beb7133c7f0cd...

38 lines
576 B
Plaintext
Raw Normal View History

2024-02-14 14:10:47 +00:00
# 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