Skip to content

Maples7/filename-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

filename-converter

Build Status Coverage Status npm version

NPM NPM

Convert an invalid filename to a valid one with a self-defined mapping table. The key point is the mapping is reversible.

Invalid Characters

/<>:"\|?* is the current set of invalid characters, see mapping_table.js to get the mapping table.

Usage

Installation

npm i filename-converter --save

Example

const filenameConverter = require('filename-converter');

const filename = 'abc:de<.json';
const ret = filenameConverter.serialize(filename);
console.log(ret); // => abc@004de@002.json
console.log(filenameConverter.deserialize(ret)); // => abc:de<.json

LICENSE

MIT

About

Convert an invalid filename to a valid one with a self-defined mapping table. The key point is the mapping is reversible.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published