版博士V2.0程序
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # path-root [![NPM version](https://img.shields.io/npm/v/path-root.svg?style=flat)](https://www.npmjs.com/package/path-root) [![NPM downloads](https://img.shields.io/npm/dm/path-root.svg?style=flat)](https://npmjs.org/package/path-root) [![Build Status](https://img.shields.io/travis/jonschlinkert/path-root.svg?style=flat)](https://travis-ci.org/jonschlinkert/path-root)
  2. > Get the root of a posix or windows filepath.
  3. You might also be interested in [parse-filepath](https://github.com/jonschlinkert/parse-filepath).
  4. ## Install
  5. Install with [npm](https://www.npmjs.com/):
  6. ```sh
  7. $ npm install path-root --save
  8. ```
  9. ## Usage
  10. ```js
  11. var pathRoot = require('path-root');
  12. ```
  13. **Examples**
  14. ```js
  15. pathRoot('\\\\server\\share\\abc');
  16. //=> '\\\\server\\share\\'
  17. pathRoot('\\\\server foo\\some folder\\base-file.js');
  18. //=> '\\\\server foo\\some folder\\'
  19. pathRoot('\\\\?\\UNC\\server\\share');
  20. //=> '\\\\?\\UNC\\'
  21. pathRoot('foo/bar/baz.js');
  22. //=> ''
  23. pathRoot('c:\\foo\\bar\\baz.js');
  24. //=> 'c:\\'
  25. pathRoot('\\\\slslslsl\\admin$\\system32');
  26. //=> '\\\\slslslsl\\admin$\\'
  27. pathRoot('/foo/bar/baz.js');
  28. //=> '/'
  29. ```
  30. ## Related projects
  31. You might also be interested in these projects:
  32. * [is-absolute](https://www.npmjs.com/package/is-absolute): Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute. | [homepage](https://github.com/jonschlinkert/is-absolute)
  33. * [parse-filepath](https://www.npmjs.com/package/parse-filepath): Parse a filepath into an object. Falls back on the native node.js `path.parse` method if… [more](https://www.npmjs.com/package/parse-filepath) | [homepage](https://github.com/jonschlinkert/parse-filepath)
  34. * [path-root-regex](https://www.npmjs.com/package/path-root-regex): Regular expression for getting the root of a posix or windows filepath. | [homepage](https://github.com/regexhq/path-root-regex)
  35. ## Contributing
  36. Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/path-root/issues/new).
  37. ## Building docs
  38. Generate readme and API documentation with [verb](https://github.com/verbose/verb):
  39. ```sh
  40. $ npm install verb && npm run docs
  41. ```
  42. Or, if [verb](https://github.com/verbose/verb) is installed globally:
  43. ```sh
  44. $ verb
  45. ```
  46. ## Running tests
  47. Install dev dependencies:
  48. ```sh
  49. $ npm install -d && npm test
  50. ```
  51. ## Author
  52. **Jon Schlinkert**
  53. * [github/jonschlinkert](https://github.com/jonschlinkert)
  54. * [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
  55. ## License
  56. Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
  57. Released under the [MIT license](https://github.com/jonschlinkert/path-root/blob/master/LICENSE).
  58. ***
  59. _This file was generated by [verb](https://github.com/verbose/verb), v, on March 29, 2016._