UNPKG

layaair2-cmd

Version:

layaair version 2 toolkit

132 lines (131 loc) 6.78 kB
{ "_args": [ [ { "raw": "detect-file@^1.0.0", "scope": null, "escapedName": "detect-file", "name": "detect-file", "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "E:\\Mine\\Project\\git\\laya\\dawawa\\layaairdoc_cmd\\node_modules\\findup-sync" ] ], "_from": "detect-file@>=1.0.0 <2.0.0", "_id": "detect-file@1.0.0", "_inCache": true, "_location": "/detect-file", "_nodeVersion": "6.10.1", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/detect-file-1.0.0.tgz_1501988960217_0.8393025605473667" }, "_npmUser": { "name": "doowb", "email": "brian.woodward@gmail.com" }, "_npmVersion": "4.6.1", "_phantomChildren": {}, "_requested": { "raw": "detect-file@^1.0.0", "scope": null, "escapedName": "detect-file", "name": "detect-file", "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "_requiredBy": [ "/findup-sync" ], "_resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", "_shasum": "f0d66d03672a825cb1b73bdb3fe62310c8e552b7", "_shrinkwrap": null, "_spec": "detect-file@^1.0.0", "_where": "E:\\Mine\\Project\\git\\laya\\dawawa\\layaairdoc_cmd\\node_modules\\findup-sync", "author": { "name": "Brian Woodward", "url": "https://github.com/doowb" }, "bugs": { "url": "https://github.com/doowb/detect-file/issues" }, "dependencies": {}, "description": "Detects if a file exists and returns the resolved filepath.", "devDependencies": { "gulp-format-md": "*", "mocha": "*" }, "directories": {}, "dist": { "shasum": "f0d66d03672a825cb1b73bdb3fe62310c8e552b7", "tarball": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz" }, "engines": { "node": ">=0.10.0" }, "files": [ "index.js" ], "gitHead": "9454484372bf7f49cc9eecf4324d1f918f698e96", "homepage": "https://github.com/doowb/detect-file", "keywords": [ "detect", "exists", "file", "file exists", "file-path", "filepath", "path", "resolve", "resolve file", "resolve filepath" ], "license": "MIT", "main": "index.js", "maintainers": [ { "name": "jonschlinkert", "email": "github@sellside.com" }, { "name": "doowb", "email": "brian.woodward@gmail.com" } ], "name": "detect-file", "optionalDependencies": {}, "readme": "# detect-file [![NPM version](https://img.shields.io/npm/v/detect-file.svg?style=flat)](https://www.npmjs.com/package/detect-file) [![NPM monthly downloads](https://img.shields.io/npm/dm/detect-file.svg?style=flat)](https://npmjs.org/package/detect-file) [![NPM total downloads](https://img.shields.io/npm/dt/detect-file.svg?style=flat)](https://npmjs.org/package/detect-file) [![Linux Build Status](https://img.shields.io/travis/doowb/detect-file.svg?style=flat&label=Travis)](https://travis-ci.org/doowb/detect-file) [![Windows Build Status](https://img.shields.io/appveyor/ci/doowb/detect-file.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/doowb/detect-file)\n\n> Detects if a file exists and returns the resolved filepath.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save detect-file\n```\n\nInstall with [yarn](https://yarnpkg.com):\n\n```sh\n$ yarn add detect-file\n```\n\n## Usage\n\n```js\nvar detect = require('detect-file');\n```\n\n## API\n\n### [detect](index.js#L33)\n\nDetect the given `filepath` if it exists.\n\n**Params**\n\n* `filepath` **{String}**: filepath to detect.\n* `options` **{Object}**: Additional options.\n* `options.nocase` **{Boolean}**: Set this to `true` to force case-insensitive filename checks. This is useful on case sensitive file systems.\n* `returns` **{String}**: Returns the detected filepath if it exists, otherwise returns `null`.\n\n**Example**\n\n```js\nvar res = detect('package.json');\nconsole.log(res);\n//=> \"package.json\"\n\nvar res = detect('fake-file.json');\nconsole.log(res)\n//=> null\n```\n\n## Case sensitive file systems\n\nWhen using the `nocase` option, this library will attempt to detect the filepath with the following methods:\n\n1. Try to read all files in the `filepath` using `fs.readdirSync`. If successful and `filepath` is a directory, return the `filepath`.\n2. 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.\n\n## About\n\n### Related projects\n\n[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.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Building docs\n\n_(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.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n### Running tests\n\nRunning 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:\n\n```sh\n$ npm install && npm test\n```\n\n### Author\n\n**Brian Woodward**\n\n* [github/doowb](https://github.com/doowb)\n* [twitter/doowb](https://twitter.com/doowb)\n\n### License\n\nCopyright © 2017, [Brian Woodward](https://github.com/doowb).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on August 05, 2017._", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/doowb/detect-file.git" }, "scripts": { "test": "mocha" }, "verb": { "layout": "default", "tasks": [ "readme" ], "plugins": [ "gulp-format-md" ], "related": { "list": [ "fs-exists-sync" ] }, "reflinks": [ "verb", "verb-readme-generator" ], "lint": { "reflinks": true } }, "version": "1.0.0" }