Node.js Flashcards
what is Node.js?
a platform built on Chrome’s JS runtime for easily building fast and scalable network applications.Backend language built with python but mostly C++ and JS. It is for running JS.
what can Node.js be used for?
primarily used for non-blocking, event-driven servers, due to its single-threaded nature. Used for traditional websites and back end API services. Make command line program using node
what is a REPL?
stands for Read Eval Print Loop. it is an interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user. Lets you run JS in your command line. Browser console is also a REPL
when was Node.js created?
created in 2009 by Ryan Dahl. it is a runtime system for creating mostly server side applications
what back end languages have you heard of?
PHP, Ruby, Java, Python, C#(.NET), C++, Pascal, Visual Basic, Pearl, Go, Elixir, Elm ,Rust
what is a computer process?
the instance of a computer program that is being executed by one or many threads. It also contains the program code and its activity. Executed by CPU threads
Roughly how many computer processes are running on your host operating system(Task Manager or Activity Monitor)?
a lot
Why should a full stack Web developer know that computer processes exist?
web dev is all about different programs talking to each other so if two processes are talking to each other, both of them have to be running, therefore you have to know if they are running
What is the process object in a Node.js program?
a global object that can be accessed inside any module without requiring it
How do you access the process object in a Node.js program?
because it is global
What is JavaScript module?
it is a single js file
What values are passed into a Node.js module’s local scope?
__dirname, __filename, exports, required, and module
Give two examples of truly global variables in a Node.js program.
the process object, console object, global object, window object
What is the purpose of module.exports in a Node.js module?
its the instruction that tells Node.js which bits of code such as functions, objects, strings are needed to export from a given file so other files are allowed to access the exported code
How do you import functionality into a Node.js module from another Node.js module?
by calling the require( ) method
What is the JavaScript Event Loop?
it is whats behind JS asynchronous programming. JS executes all operations on a single thread, but uses a few data structures
What is the JavaScript Event Loop?
it is whats behind JS asynchronous programming. JS executes all operations on a single thread, but uses a few data structures. Part of the JS run time that checks for asyncrynous call backs and puts it back on the stack when it is ready
What is different between “blocking” and “non-blocking” with respect to how code is executed?
blocking statements is executed sequentially one after another, while non blocking executes parallel. Blocking is the code thats on the stack. non blocking is things that are happening off the stack
What is a directory?
its a file that points to other files
What is an absolute file path?
sometimes known as the full path, it includes the complete location of the file or folder.
What is an absolute file path?
sometimes known as the full path, it includes the complete location of the file or folder.
What method is available in the Node.js fs module for writing data to a file?
writeFile method
Are file operations using the fs module synchronous or asynchronous?
it is both forms.