/ archiveofbelonging.org / back / node_modules / fined /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[   ]package.json2 years ago2.1K7375cab EXHIBTION: fix overflow ellipsis cutoff [كارل مبارك]
[   ]index.js39 years ago3.7K 
[TXT]README.md39 years ago2.5Kf12eb36 documentaiton updates [كارل مبارك]
[   ]LICENSE39 years ago1.1K7375cab EXHIBTION: fix overflow ellipsis cutoff [كارل مبارك]
README.md

fined

NPM version Downloads Travis Build Status AppVeyor Build Status Coveralls Status Gitter chat

Find a file given a declaration of locations.

Usage

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);
// => { path: '/User/home/.apprc', extension: { 'rc': 'some-special-rc-loader' } }

API

fined(pathObj, opts) => object | null

Arguments:

Return:

This function returns a plain object which consists of following properties if a file exists otherwise null.

License

MIT

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80