Core ModulesLesson 24Free preview
Path Module
This lesson is part of Node.js · All levels
Summary
The path module provides a utility for manipulating string path files securely across platforms. The join, resolve, and normalize functions help to set the path without worrying about the differences between Windows and Unix separators. Using the path module prevents bugs from typing the path manually incorrectly.
Key points
- Path.join unite the path section with the proper separator
- Create an absolute path based on the current working directory
- Path.basename, dirname, and extname disconnect path components
- Always use the path module to secure across platforms (Windows and Linux)
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.