valid-filename
Check if a string is a valid filename
Last updated 3 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm 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

  • 4.0.0                                ...           latest (3 years ago)

8 Versions

  • 4.0.0                                ...           3 years ago
  • 3.1.0                                ...           6 years ago
  • 3.0.0                                ...           6 years ago
  • 2.0.1                                ...           8 years ago
  • 2.0.0                                ...           8 years ago
  • 1.1.1                                ...           9 years ago
  • 1.1.0                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (3)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |