Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

normalize-path

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

normalize-path - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

benchmark/code/no-regex.js

17

.verbrc.md

@@ -6,4 +6,10 @@ # {%= name %} {%= badge("fury") %}

## Install
{%= include("install") %}
{%= include("install-npm", {save: true}) %}
## Run tests
```bash
npm test
```
## Usage

@@ -13,6 +19,13 @@

var normalize = require('{%= name %}');
console.log(normalize('\\foo\\bar\\baz\\'));
//=> '//foo/bar/baz'
//=> '/foo/bar/baz'
console.log(normalize('./foo/bar/baz'));
//=> 'foo/bar/baz'
```
## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue]({%= bugs.url %}).
## Author

@@ -19,0 +32,0 @@ {%= include("author") %}

15

index.js
/*!
* normalize-path
* https://github.com/jonschlinkert/normalize-path
* normalize-path <https://github.com/jonschlinkert/normalize-path>
*

@@ -11,8 +10,8 @@ * Copyright (c) 2014 Jon Schlinkert, contributors.

var path = require('path');
module.exports = function(filepath) {
return path.normalize(filepath)
.replace(/\\/g, '/')
.replace(/\/$/g, '');
};
return filepath
.replace(/[\\\/]+/g, '/')
.replace(/^\.[\\\/]/g, '')
.replace(/\/$/g, '')
.toLowerCase();
};
{
"name": "normalize-path",
"description": "Normalize file path slashes to be unix-like forward slashes, regardless of OS (since in reality Windows doesn't care about slash direction anyway). Also condenses repeat slashes to a single slash and removes and trailing slashes.",
"version": "0.1.1",
"description": "Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes.",
"version": "0.2.0",
"homepage": "https://github.com/jonschlinkert/normalize-path",

@@ -24,7 +24,11 @@ "author": {

"keywords": [
"file",
"filepath",
"fp",
"normalize",
"path",
"filepath",
"slash",
"slashes"
"slashes",
"trailing",
"unix"
],

@@ -39,6 +43,7 @@ "main": "index.js",

"devDependencies": {
"verb": "~0.2.6",
"chai": "~1.9.1",
"mocha": "*"
"benchmarked": "^0.1.1",
"mocha": "*",
"should": "^4.0.4",
"verb": "^0.2.15"
}
}
}

@@ -1,12 +0,18 @@

# normalize-path [![NPM version](https://badge.fury.io/js/normalize-path.png)](http://badge.fury.io/js/normalize-path)
# normalize-path [![NPM version](https://badge.fury.io/js/normalize-path.svg)](http://badge.fury.io/js/normalize-path)
> Normalize file path slashes to be unix-like forward slashes, regardless of OS (since in reality Windows doesn't care about slash direction anyway). Also condenses repeat slashes to a single slash and removes and trailing slashes.
> 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](npmjs.org):
#### Install with [npm](npmjs.org)
```bash
npm i normalize-path --save-dev
npm i normalize-path --save
```
## Run tests
```bash
npm test
```
## Usage

@@ -16,6 +22,13 @@

var normalize = require('normalize-path');
console.log(normalize('\\foo\\bar\\baz\\'));
//=> '//foo/bar/baz'
//=> '/foo/bar/baz'
console.log(normalize('./foo/bar/baz'));
//=> 'foo/bar/baz'
```
## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/normalize-path/issues).
## Author

@@ -34,2 +47,2 @@

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 25, 2014._
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 18, 2014._
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc