UNPKG

@yodata/transform

Version:

declarative, JSON transformation library

13 lines (10 loc) 290 B
'use strict' const fs = require('fs') const path = require('path') const callerPath = require('caller-path') module.exports = isFile function isFile(target) { const dirName = path.dirname(callerPath()) const pathname = path.resolve(dirName, target) return fs.existsSync(pathname) }