In this video, learn how to execute a child process with the exec function in Node.js. With the exec function, you can execute local system commands, and it's perfect for system commands that synchronously run and output small amounts of data.
- [Instructor] Note, JS comes with a child process module, … which allows you to execute external processes … in your environment. … In other words, you node JS app can run and communicate … with other applications within the environment … that is hosted. … In the next two lessons, we're going to take a look … at the two main functions used to create a child process, … spawn and execute. … So far, we've been running our node files from our terminal. … We're typing into the terminal or … dos command prompt system commands. … I'm working on a Mac so the system commands … I can used are based on unix and work in a unix environment. … Come over here and add a new file. … And this file is going to be called EXEC dot js. … And what were going to do is we're going to take a look at … the child process module. … So let's first include it. … CP will equal require, child underscore process. … So all of the commands that I have just … executed are synchronous. … They run once, spit out some data, …
- What is Node.js?
- Installing Node.js
- The global object
- Importing the core modules
- Creating custom events with the EventEmitter
- Reading, writing, and removing files
- Working with file streams
- Creating child processes with the exec and spawn functions
Skill Level Intermediate
Node.js: Real-Time Web with Socket.IOwith Emmanuel Henri1h 24m Intermediate
1. What Is Node.js?
2. Set Up Your Environnment
3. Node Globals
4. Node Modules
5. File System Basics
6. Files and Streams
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.