Skip to content

trytelework/filetouch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

filetouch

Exposes a synchronous if (!fs.existsSync(...)) check around an fs.writeFileSync or fs.mkdirSync call, depending on whether filetouch.dir or filetouch.file is called.

Files are not modified if they already exist.

const filetouch = require('filetouch');

// create test.txt if doesn't exist
filetouch.file('test.txt');

// create test2.txt and write into it, if doesn't exist
filetouch.file('test2.txt', 'test text goes here');

// create test3 directory if doesn't exist
filetouch.dir('test3');

About

A utility for seamlessly creating directories and files if they do not exist.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published