files-require-hook
require files as paths
install
with npm
, run
npm install --save files-require-hook
usage
require('files-require-hook')({
extensions: ['png', 'svg'],
base: process.cwd()
})
var filePath = require('./file.txt')
console.log(filePath) // file.txt