32981bb5fa6f73ca42b50c221badb6ad6ecf32b39e4ffde39f316c9805dae15f01fba2022101b7970bf5000eb3f67a10caadb96d6ce12a67b29d83cf557392 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # normalize-path [![NPM version](https://badge.fury.io/js/normalize-path.svg)](http://badge.fury.io/js/normalize-path)
  2. > Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes.
  3. ## Install with [npm](npmjs.org)
  4. ```bash
  5. npm i normalize-path --save
  6. ```
  7. ## Usage
  8. ```js
  9. var normalize = require('normalize-path');
  10. normalize('\\foo\\bar\\baz\\');
  11. //=> '/foo/bar/baz'
  12. normalize('./foo/bar/baz/');
  13. //=> './foo/bar/baz'
  14. ```
  15. Pass `false` as the last argument to **not** strip trailing slashes:
  16. ```js
  17. normalize('./foo/bar/baz/', false);
  18. //=> './foo/bar/baz/'
  19. normalize('foo\\bar\\baz\\', false);
  20. //=> 'foo/bar/baz/'
  21. ```
  22. ## Run tests
  23. ```bash
  24. npm i -d && npm test
  25. ```
  26. ## Contributing
  27. Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/normalize-path/issues).
  28. ## Author
  29. **Jon Schlinkert**
  30. + [github/jonschlinkert](https://github.com/jonschlinkert)
  31. + [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
  32. ## License
  33. Copyright (c) 2015 Jon Schlinkert
  34. Released under the MIT license
  35. ***
  36. _This file was generated by [verb](https://github.com/assemble/verb) on January 23, 2015._