normalize-path 2.0.1

Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes.

Homepage: https://github.com/jonschlinkert/normalize-path

Platform: npm

Language: JavaScript

License: MIT

Keywords: backslash, file, filepath, fix, forward, fp, fs, normalize, path, slash, slashes, trailing, unix, urix

View on registry: https://www.npmjs.com/package/normalize-path

Direct download link: https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz

Install: npm install [email protected]


normalize-path NPM version Build Status

Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes.

Install

Install with npm

$ npm i normalize-path --save

Usage

var normalize = require('normalize-path');

normalize('\\foo\\bar\\baz\\');
//=> '/foo/bar/baz'

normalize('./foo/bar/baz/');
//=> './foo/bar/baz'

Pass false as the last argument to not strip trailing slashes:

normalize('./foo/bar/baz/', false);
//=> './foo/bar/baz/'

normalize('foo\\bar\\baz\\', false);
//=> 'foo/bar/baz/'

Related

Other useful libraries for working with paths in node.js:

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on November 17, 2015.

Releases

  • 2.0.1 - November 17, 2015 12:32
  • 2.0.0 - October 04, 2015 06:22
  • 1.0.0 - January 24, 2015 02:00
  • 0.3.0 - October 24, 2014 07:35
  • 0.2.1 - October 19, 2014 01:19
  • 0.2.0 - October 19, 2014 01:03
  • 0.1.1 - July 06, 2014 12:22
  • 0.1.0 - June 26, 2014 01:32

Project Statistics

SourceRank 18
Dependencies 0
Dependent projects 78
Dependent repositories 8.36K
Total releases 8
Latest release
First release
Stars 17
Forks 1
Watchers 2
Contributors 1
Repo Size: 23.4 KB

Top Contributors See all

Jon Schlinkert

Something wrong with this page? Make a suggestion

Export .ABOUT file for this library

Last synced: 2017-02-08 13:21:06 UTC

Login to resync this project