md5storage
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

md5storage

计算文件的md5值,并存入指定目录, 并用md5当文件名,可以避免重复文件

一般用法

let store = new MD5Storage("tempFolderPath");

let myfile = "pathToFile"; let newfile = "对应myfile的转换后新文件";

let md5file = store.getValidPath(myfile); if(md5file){ //文件已经存在

// 读取文件内容
fs.readSync(md5file);

} else{ //文件不存在

//保存新文件
store.save(myfile,newfile);

}

Readme

Keywords

none

Package Sidebar

Install

npm i md5storage

Weekly Downloads

4

Version

1.0.3

License

ISC

Unpacked Size

12 kB

Total Files

8

Last publish

Collaborators

  • w2moon