Skip to content

Instantly share code, notes, and snippets.

@Bamblehorse
Created July 18, 2018 14:40
Show Gist options
  • Save Bamblehorse/abf3c1a151a57341d1edded088a93ff8 to your computer and use it in GitHub Desktop.
Save Bamblehorse/abf3c1a151a57341d1edded088a93ff8 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment