UNPKG

@zkochan/pnpm

Version:

Fast, disk space efficient package manager

109 lines (108 loc) 6.44 kB
{ "_args": [ [ { "raw": "glob-parent@^3.1.0", "scope": null, "escapedName": "glob-parent", "name": "glob-parent", "rawSpec": "^3.1.0", "spec": ">=3.1.0 <4.0.0", "type": "range" }, "/home/zkochan/src/pnpm/packages/pnpm/node_modules/fast-glob" ] ], "_from": "glob-parent@>=3.1.0 <4.0.0", "_id": "glob-parent@3.1.0", "_inCache": true, "_location": "/glob-parent", "_nodeVersion": "6.7.0", "_npmOperationalInternal": { "host": "packages-18-east.internal.npmjs.com", "tmp": "tmp/glob-parent-3.1.0.tgz_1481730526821_0.4327609031461179" }, "_npmUser": { "name": "es128", "email": "elan.shanker+npm@gmail.com" }, "_npmVersion": "3.10.3", "_phantomChildren": { "is-extglob": "2.1.1" }, "_requested": { "raw": "glob-parent@^3.1.0", "scope": null, "escapedName": "glob-parent", "name": "glob-parent", "rawSpec": "^3.1.0", "spec": ">=3.1.0 <4.0.0", "type": "range" }, "_requiredBy": [ "/fast-glob" ], "_resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", "_shasum": "9e6af6299d8d3bd2bd40430832bd113df906c5ae", "_shrinkwrap": null, "_spec": "glob-parent@^3.1.0", "_where": "/home/zkochan/src/pnpm/packages/pnpm/node_modules/fast-glob", "author": { "name": "Elan Shanker", "url": "https://github.com/es128" }, "bugs": { "url": "https://github.com/es128/glob-parent/issues" }, "dependencies": { "is-glob": "^3.1.0", "path-dirname": "^1.0.0" }, "description": "Strips glob magic from a string to provide the parent directory path", "devDependencies": { "coveralls": "^2.11.2", "istanbul": "^0.3.5", "mocha": "^2.1.0" }, "directories": {}, "dist": { "shasum": "9e6af6299d8d3bd2bd40430832bd113df906c5ae", "tarball": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz" }, "files": [ "index.js" ], "gitHead": "880243f7758be2967318280ad3e599c95e832a76", "homepage": "https://github.com/es128/glob-parent", "keywords": [ "glob", "parent", "strip", "path", "dirname", "directory", "base", "wildcard" ], "license": "ISC", "main": "index.js", "maintainers": [ { "name": "es128", "email": "elan.shanker+npm@gmail.com" } ], "name": "glob-parent", "optionalDependencies": {}, "readme": "glob-parent [![Build Status](https://travis-ci.org/es128/glob-parent.svg)](https://travis-ci.org/es128/glob-parent) [![Coverage Status](https://img.shields.io/coveralls/es128/glob-parent.svg)](https://coveralls.io/r/es128/glob-parent?branch=master)\n======\nJavascript module to extract the non-magic parent path from a glob string.\n\n[![NPM](https://nodei.co/npm/glob-parent.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/glob-parent/)\n[![NPM](https://nodei.co/npm-dl/glob-parent.png?height=3&months=9)](https://nodei.co/npm-dl/glob-parent/)\n\nUsage\n-----\n```sh\nnpm install glob-parent --save\n```\n\n**Examples**\n\n```js\nvar globParent = require('glob-parent');\n\nglobParent('path/to/*.js'); // 'path/to'\nglobParent('/root/path/to/*.js'); // '/root/path/to'\nglobParent('/*.js'); // '/'\nglobParent('*.js'); // '.'\nglobParent('**/*.js'); // '.'\nglobParent('path/{to,from}'); // 'path'\nglobParent('path/!(to|from)'); // 'path'\nglobParent('path/?(to|from)'); // 'path'\nglobParent('path/+(to|from)'); // 'path'\nglobParent('path/*(to|from)'); // 'path'\nglobParent('path/@(to|from)'); // 'path'\nglobParent('path/**/*'); // 'path'\n\n// if provided a non-glob path, returns the nearest dir\nglobParent('path/foo/bar.js'); // 'path/foo'\nglobParent('path/foo/'); // 'path/foo'\nglobParent('path/foo'); // 'path' (see issue #3 for details)\n```\n\n## Escaping\n\nThe following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters:\n\n- `?` (question mark)\n- `*` (star)\n- `|` (pipe)\n- `(` (opening parenthesis)\n- `)` (closing parenthesis)\n- `{` (opening curly brace)\n- `}` (closing curly brace)\n- `[` (opening bracket)\n- `]` (closing bracket)\n\n**Example**\n\n```js\nglobParent('foo/[bar]/') // 'foo'\nglobParent('foo/\\\\[bar]/') // 'foo/[bar]'\n```\n\n## Limitations\n\n#### Braces & Brackets\nThis library attempts a quick and imperfect method of determining which path\nparts have glob magic without fully parsing/lexing the pattern. There are some\nadvanced use cases that can trip it up, such as nested braces where the outer\npair is escaped and the inner one contains a path separator. If you find\nyourself in the unlikely circumstance of being affected by this or need to\nensure higher-fidelity glob handling in your library, it is recommended that you\npre-process your input with [expand-braces] and/or [expand-brackets].\n\n#### Windows\nBackslashes are not valid path separators for globs. If a path with backslashes\nis provided anyway, for simple cases, glob-parent will replace the path\nseparator for you and return the non-glob parent path (now with\nforward-slashes, which are still valid as Windows path separators).\n\nThis cannot be used in conjunction with escape characters.\n\n```js\n// BAD\nglobParent('C:\\\\Program Files \\\\(x86\\\\)\\\\*.ext') // 'C:/Program Files /(x86/)'\n\n// GOOD\nglobParent('C:/Program Files\\\\(x86\\\\)/*.ext') // 'C:/Program Files (x86)'\n```\n\nIf you are using escape characters for a pattern without path parts (i.e.\nrelative to `cwd`), prefix with `./` to avoid confusing glob-parent.\n\n```js\n// BAD\nglobParent('foo \\\\[bar]') // 'foo '\nglobParent('foo \\\\[bar]*') // 'foo '\n\n// GOOD\nglobParent('./foo \\\\[bar]') // 'foo [bar]'\nglobParent('./foo \\\\[bar]*') // '.'\n```\n\n\nChange Log\n----------\n[See release notes page on GitHub](https://github.com/es128/glob-parent/releases)\n\nLicense\n-------\n[ISC](https://raw.github.com/es128/glob-parent/master/LICENSE)\n\n[expand-braces]: https://github.com/jonschlinkert/expand-braces\n[expand-brackets]: https://github.com/jonschlinkert/expand-brackets\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/es128/glob-parent.git" }, "scripts": { "ci-test": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls", "test": "istanbul test node_modules/mocha/bin/_mocha" }, "version": "3.1.0" }