Skip to content

About

Check if a string is a valid filename

Resources

Code of conduct

Contributing

Stars

61 stars

Watchers

5 watching

Forks

Repository files navigation

valid-filename

Check if a string is a valid filename

Install

npm install valid-filename

Usage

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 - Convert a string to a valid safe filename

About

Check if a string is a valid filename

Resources

Code of conduct

Contributing

Stars

61 stars

Watchers

5 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages