THE WORLD'S LARGEST WEB DEVELOPER SITE

Node.js path.normalize() Method

❮ Path Module


Example

Resolve the path:

var path = require('path');

var x = path.normalize('Users/Refsnes/../Jackson');

console.log(x);
Run example »

Definition and Usage

The path.normalize() method resolves the specified path, fixing '..','\\\\' etc.


Syntax

path.normalize(path);

Parameter Values

Parameter Description
path Required. A string. The path you want to normalize.

Technical Details

Return Value: A String, representing the normalized path
Node.js Version: 0.1.23

❮ Path Module