VOOZH about

URL: https://www.geeksforgeeks.org/node-js/node-js-path-tonamespacedpath-method/

⇱ Node.js path.toNamespacedPath() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Node.js path.toNamespacedPath() Method

Last Updated : 8 Oct, 2021
The path.toNamespacedPath() method is used to find the equivalent namespace-prefixed path from the given path. This method is meaningful only on Windows Systems. It would return the same path without modification on POSIX systems. If the path is not a string, it would be returned without modification. Syntax:
path.toNamespacedPath( path )
Parameters: This function accepts single parameter as mentioned above and described below:
  • path: It is an string which contains the path that has to be converted.
Return Value: It returns a string with an equivalent namespace-prefixed path. Below programs illustrate the path.toNamespacedPath() method: Example 1: Output:
Original Path: C:\Windows\users
Namespaced Path: \\?\C:\Windows\users
Example 2: Output:
Original Path: C:\Windows\users\..\admin
Namespaced Path: \\?\C:\Windows\admin
Reference: https://nodejs.org/api/path.html#path_path_tonamespacedpath_path
Comment

Explore