diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-10-10 03:43:44 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-10-10 03:43:44 +0200 |
commit | abd94a7f5a50f43c797a11b53549ae48fff667c3 (patch) | |
tree | ab8ed457f65cdd72e13e0571d2975729428f1551 /node_modules/fined/README.md | |
parent | a0247c6a3fd6a09a41a7e35a3441324c4dcb58be (diff) |
add node_modules to address #4364
Diffstat (limited to 'node_modules/fined/README.md')
-rw-r--r-- | node_modules/fined/README.md | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/node_modules/fined/README.md b/node_modules/fined/README.md new file mode 100644 index 000000000..8788de09f --- /dev/null +++ b/node_modules/fined/README.md @@ -0,0 +1,67 @@ +# Fined [![Build Status][travis-image]][travis-url] [![Build Status][appveyor-image]][appveyor-url] + +> Find a file given a declaration of locations + +[](https://nodei.co/npm/fined/) + +## Usage + +```js +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: + +* **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** [string] : a path string. + * **name** [string] : a basename. + * **extensions**: [string | array | object] : extensions. + * **cwd**: a base directory of `path` and for finding up. + * **findUp**: [boolean] : a flag to find up. + +#### Return: + +This function returns a plain object which consists of following properties if a file exists otherwise null. + + * **path** : an absolute path + * **extension** : a string or a plain object of extension. + + +## License + +MIT + + +[npm-image]: http://img.shields.io/badge/npm-v0.0.0-blue.svg +[npm-url]: https://www.npmjs.org/package/fined +[travis-image]: https://travis-ci.org/js-cli/fined.svg?branch=master +[travis-url]: https://travis-ci.org/js-cli/fined +[appveyor-image]: https://ci.appveyor.com/api/projects/status/github/js-cli/fined?branch=master&svg=true +[appveyor-url]: https://ci.appveyor.com/project/js-cli/fined |