package
Find a file given a declaration of locations.
npm install finedGitHub-flavored package documentation.
Across all versions, last 30 days.
20,635,021 in 30 days
Runtime metadata.
Tagged topics.
Find a file given a declaration of locations.
var fined = require('fined');
fined({ path: 'path/to/file', extensions: ['.js', '.json'] });
// => { path: '/absolute/path/to/file.js', extension: '.js' } (if file exists)
// => null (if file does not exist)
var opts = {
name: '.app',
cwd: '.',
extensions: {
rc: 'default-rc-loader',
'.yml': 'default-yml-loader',
},
};
fined({ path: '.' }, opts);
// => { path: '/absolute/of/cwd/.app.yml', extension: { '.yml': 'default-yml-loader' } }
fined({ path: '~', extensions: { rc: 'some-special-rc-loader' } }, opts);
pathObj [string | object] : a path setting for finding a file.
opts [object] : a plain object supplements pathObj.
pathObj and opts can have same properties:
path and for finding up.This function returns a plain object which consists of following properties if a file exists otherwise null.
MIT
Estimated unpacked size across 19 packages.
35.4 kB
Includes dependencies.
5 direct dependencies.
^1.3.0
1.3.0
^2.0.2
2.0.2
^1.0.2
1.0.2
^5.0.0
5.1.0
^1.1.0
1.1.0