diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/detect-file/README.md | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) |
update packages
Diffstat (limited to 'node_modules/detect-file/README.md')
-rw-r--r-- | node_modules/detect-file/README.md | 61 |
1 files changed, 35 insertions, 26 deletions
diff --git a/node_modules/detect-file/README.md b/node_modules/detect-file/README.md index e5691dd82..dee631119 100644 --- a/node_modules/detect-file/README.md +++ b/node_modules/detect-file/README.md @@ -1,6 +1,6 @@ -# detect-file [](https://www.npmjs.com/package/detect-file) [](https://npmjs.org/package/detect-file) [](https://travis-ci.org/doowb/detect-file) +# detect-file [](https://www.npmjs.com/package/detect-file) [](https://npmjs.org/package/detect-file) [](https://npmjs.org/package/detect-file) [](https://travis-ci.org/doowb/detect-file) [](https://ci.appveyor.com/project/doowb/detect-file) -Detect if a filepath exists and resolves the full filepath. +> Detects if a file exists and returns the resolved filepath. ## Install @@ -10,6 +10,12 @@ Install with [npm](https://www.npmjs.com/): $ npm install --save detect-file ``` +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add detect-file +``` + ## Usage ```js @@ -18,16 +24,16 @@ var detect = require('detect-file'); ## API -### [detect](index.js#L34) +### [detect](index.js#L33) -Resolve the given `filepath` if it exists. +Detect the given `filepath` if it exists. **Params** * `filepath` **{String}**: filepath to detect. * `options` **{Object}**: Additional options. -* `options.nocase` **{Boolean}**: Set this to `true` force case-insensitive filename checks. This is useful on case sensitive file systems. -* `returns` **{String}**: Returns the resolved filepath if it exists, otherwise returns `null`. +* `options.nocase` **{Boolean}**: Set this to `true` to force case-insensitive filename checks. This is useful on case sensitive file systems. +* `returns` **{String}**: Returns the detected filepath if it exists, otherwise returns `null`. **Example** @@ -41,50 +47,53 @@ console.log(res) //=> null ``` -## Related projects +## Case sensitive file systems -You might also be interested in these projects: +When using the `nocase` option, this library will attempt to detect the filepath with the following methods: -[fs-exists-sync](https://www.npmjs.com/package/fs-exists-sync): Drop-in replacement for `fs.existsSync` with zero dependencies. Other libs I found either have crucial differences… [more](https://github.com/jonschlinkert/fs-exists-sync) | [homepage](https://github.com/jonschlinkert/fs-exists-sync "Drop-in replacement for `fs.existsSync` with zero dependencies. Other libs I found either have crucial differences from fs.existsSync, or unnecessary dependencies. See README.md for more info.") +1. Try to read all files in the `filepath` using `fs.readdirSync`. If successful and `filepath` is a directory, return the `filepath`. +2. Try to read all files in the `filepath`'s directory using `fs.readdirSync`. If successful, do case insensitive comparasions of the `filepath` to the files in `filepath`'s directory. -## Contributing +## About -This document was generated by [verb-readme-generator](https://github.com/verbose/verb-readme-generator) (a [verb](https://github.com/verbose/verb) generator), please don't edit directly. Any changes to the readme must be made in [.verb.md](.verb.md). See [Building Docs](#building-docs). +### Related projects -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). +[fs-exists-sync](https://www.npmjs.com/package/fs-exists-sync): Drop-in replacement for `fs.existsSync` with zero dependencies. Other libs I found either have crucial differences… [more](https://github.com/jonschlinkert/fs-exists-sync) | [homepage](https://github.com/jonschlinkert/fs-exists-sync "Drop-in replacement for `fs.existsSync` with zero dependencies. Other libs I found either have crucial differences from fs.existsSync, or unnecessary dependencies. See README.md for more info.") -Or visit the [verb-readme-generator](https://github.com/verbose/verb-readme-generator) project to submit bug reports or pull requests for the readme layout template. +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). -## Building docs +### Building docs -_(This document was generated by [verb-readme-generator](https://github.com/verbose/verb-readme-generator) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ -Generate readme and API documentation with [verb](https://github.com/verbose/verb): +To generate the readme, run the following command: ```sh -$ npm install -g verb verb-readme-generator && verb +$ npm install -g verbose/verb#dev verb-generate-readme && verb ``` -## Running tests +### Running tests -Install dev dependencies: +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: ```sh -$ npm install -d && npm test +$ npm install && npm test ``` -## Author +### Author **Brian Woodward** * [github/doowb](https://github.com/doowb) -* [twitter/doowb](http://twitter.com/doowb) +* [twitter/doowb](https://twitter.com/doowb) -## License +### License -Copyright © 2016, [Brian Woodward](https://github.com/doowb). -Released under the [MIT license](https://github.com/doowb/detect-file/blob/master/LICENSE). +Copyright © 2017, [Brian Woodward](https://github.com/doowb). +Released under the [MIT License](LICENSE). *** -_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on July 06, 2016._
\ No newline at end of file +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on August 05, 2017._
\ No newline at end of file |