From the course: Master Next.js by Building Scalable Apps with Routing, Databases, and Performance

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

RQ: Updating product with server action

RQ: Updating product with server action

Let's discuss about few relative questions here. So what is the process in Node.js? So process is a global object which provides information and the control over the current processes. Let me simplify for you. By using the process object, we can access the environment variables using process.env.variableName. We can get the information about the running process or we can exit the ongoing process using the process.exit method. We can get the path of the working directories using the process.cwd method. We can handle several events using the process.on method as well. The next question, what's the use of fs.existsync method and fs.unlinksync method? As we have seen in the previous lecture, when we need to check the existence of a file or folder, we can use the existsync method. It takes the path as an argument and returns the boolean value which indicates the existence of the file. Here you may have a string, buffer, or URL as argument. Next, the fsunlinksync method is used to remove a…

Contents