Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fs = require('fs');
- const fileExists = path => file => fs.existsSync(`${path}/${file}`);
- const fileExistsInSrc = fileExists('/src'); // file => fs.existsSync(`${path}/${file}`)
- fileExistsInSrc('index.js') // true || false
Add Comment
Please, Sign In to add comment