UNPKG

flipfile

Version:

file helpers for reading, writing, deleting, checking types & existence, extracting metadata, walking, globbing, and more.

10 lines (9 loc) 221 B
module.exports = function getFileAndPath(file) { const split = file.split('/') const fileAndPath = { file: split.pop(), paths: split.join('/'), } fileAndPath.dir = fileAndPath.paths return fileAndPath }