Tutorials References Exercises Bootcamps Videos Menu
Sign Up Create Website Get Certified Upgrade

Node.js path.format() Method

❮ Path Module


Format a path object into a string and return the result:

var path = require('path');
var obj = { dir: 'C:\\Users\\Refsnes', base: 'demo_path.js' }

var p = path.format(obj);
Run example »

Definition and Usage

The path.format() method formats a path object into a path string.



Parameter Values

Parameter Description
pathObject Required. The path object to format

Technical Details

Return Value: The path, as a String
Node.js Version: 0.11.15

❮ Path Module