From abd94a7f5a50f43c797a11b53549ae48fff667c3 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 10 Oct 2016 03:43:44 +0200 Subject: add node_modules to address #4364 --- node_modules/path-type/index.js | 29 +++++++++ node_modules/path-type/license | 21 +++++++ node_modules/path-type/package.json | 115 ++++++++++++++++++++++++++++++++++++ node_modules/path-type/readme.md | 42 +++++++++++++ 4 files changed, 207 insertions(+) create mode 100644 node_modules/path-type/index.js create mode 100644 node_modules/path-type/license create mode 100644 node_modules/path-type/package.json create mode 100644 node_modules/path-type/readme.md (limited to 'node_modules/path-type') diff --git a/node_modules/path-type/index.js b/node_modules/path-type/index.js new file mode 100644 index 000000000..207a1d19c --- /dev/null +++ b/node_modules/path-type/index.js @@ -0,0 +1,29 @@ +'use strict'; +var fs = require('graceful-fs'); +var Promise = require('pinkie-promise'); +var pify = require('pify'); + +function type(fn, fn2, fp) { + if (typeof fp !== 'string') { + return Promise.reject(new TypeError('Expected a string')); + } + + return pify(fs[fn], Promise)(fp).then(function (stats) { + return stats[fn2](); + }); +} + +function typeSync(fn, fn2, fp) { + if (typeof fp !== 'string') { + throw new TypeError('Expected a string'); + } + + return fs[fn](fp)[fn2](); +} + +exports.file = type.bind(null, 'stat', 'isFile'); +exports.dir = type.bind(null, 'stat', 'isDirectory'); +exports.symlink = type.bind(null, 'lstat', 'isSymbolicLink'); +exports.fileSync = typeSync.bind(null, 'statSync', 'isFile'); +exports.dirSync = typeSync.bind(null, 'statSync', 'isDirectory'); +exports.symlinkSync = typeSync.bind(null, 'lstatSync', 'isSymbolicLink'); diff --git a/node_modules/path-type/license b/node_modules/path-type/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/path-type/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/path-type/package.json b/node_modules/path-type/package.json new file mode 100644 index 000000000..4232923ed --- /dev/null +++ b/node_modules/path-type/package.json @@ -0,0 +1,115 @@ +{ + "_args": [ + [ + { + "raw": "path-type@^1.0.0", + "scope": null, + "escapedName": "path-type", + "name": "path-type", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/read-pkg" + ] + ], + "_from": "path-type@>=1.0.0 <2.0.0", + "_id": "path-type@1.1.0", + "_inCache": true, + "_location": "/path-type", + "_nodeVersion": "4.2.1", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "raw": "path-type@^1.0.0", + "scope": null, + "escapedName": "path-type", + "name": "path-type", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/read-pkg" + ], + "_resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "_shasum": "59c44f7ee491da704da415da5a4070ba4f8fe441", + "_shrinkwrap": null, + "_spec": "path-type@^1.0.0", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/read-pkg", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/path-type/issues" + }, + "dependencies": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "description": "Check if a path is a file, directory, or symlink", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "59c44f7ee491da704da415da5a4070ba4f8fe441", + "tarball": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "dff5c2a62f89efe7e0cce600bf38e76196d8b4b2", + "homepage": "https://github.com/sindresorhus/path-type", + "keywords": [ + "path", + "fs", + "type", + "is", + "check", + "directory", + "dir", + "file", + "filepath", + "symlink", + "symbolic", + "link", + "stat", + "stats", + "filesystem" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "path-type", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-type.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.1.0", + "xo": { + "ignores": [ + "test.js" + ] + } +} diff --git a/node_modules/path-type/readme.md b/node_modules/path-type/readme.md new file mode 100644 index 000000000..eac12d609 --- /dev/null +++ b/node_modules/path-type/readme.md @@ -0,0 +1,42 @@ +# path-type [![Build Status](https://travis-ci.org/sindresorhus/path-type.svg?branch=master)](https://travis-ci.org/sindresorhus/path-type) + +> Check if a path is a file, directory, or symlink + + +## Install + +``` +$ npm install --save path-type +``` + + +## Usage + +```js +var pathType = require('path-type'); + +pathType.file('package.json').then(function (isFile) { + console.log(isFile); + //=> true +}) +``` + + +## API + +### .file(path) +### .dir(path) +### .symlink(path) + +Returns a promise that resolves to a boolean of whether the path is the checked type. + +### .fileSync(path) +### .dirSync(path) +### .symlinkSync(path) + +Returns a boolean of whether the path is the checked type. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) -- cgit v1.2.3