file-validizer
v1.0.0
Published
Returns a valid filename from whatever was sent as a param.
Downloads
3
Readme
file-validizer
Convert a string to a valid safe filename
Install
$ npm install file-validizer
Usage
const validateFileName = require('file-validizer');
await validateFileName('<foo/bar>');
//=> '<foo_bar>'
validateFileName('hel/lo.png').then((result => {
//...do something with result ('hel_lo.png')...//
}));
Thanks to
- filenamify - Most code borrowed from, but needed an update to work with ES6