valid-filename
Check if a string is a valid filename
Last updated 3 months ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install valid-filename 
SYNC missed versions from official npm registry.

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

Current Tags

  • 5.0.0                                ...           latest (3 months ago)

9 Versions

  • 5.0.0                                ...           3 months ago
  • 4.0.0                                ...           5 years ago
  • 3.1.0                                ...           8 years ago
  • 3.0.0                                ...           8 years ago
  • 2.0.1                                ...           10 years ago
  • 2.0.0                                ...           10 years ago
  • 1.1.1                                ...           11 years ago
  • 1.1.0                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 16
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 8
Dependencies (1)
Dev Dependencies (3)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE