Edited, memorised or added to reading list

on 05-Apr-2019 (Fri)

Do you want BuboFlash to help you learning these things? Click here to log in or create user.

#node

What is a Module

A module encapsulates related code into a single unit of code. When creating a module, this can be interpreted as moving all related functions into a file. Let’s illustrate this point with an example involving an application built with Node.js. Imagine that we created a file called greetings.js and it contains the following two functions:

// greetings.js
sayHelloInEnglish = function() {
return "Hello";
};

sayHelloInSpanish = function() {

statusnot read reprioritisations
last reprioritisation on reading queue position [%]
started reading on finished reading on

Understanding module.exports and exports in Node.js
ou can use modules inside of the browser, read: Understanding JavaScript Modules: Bundling & Transpiling . You can also get a greater understanding of Node in: Your First Week With Node.js. <span>What is a Module A module encapsulates related code into a single unit of code. When creating a module, this can be interpreted as moving all related functions into a file. Let’s illustrate this point with an example involving an application built with Node.js. Imagine that we created a file called greetings.js and it contains the following two functions: // greetings.js sayHelloInEnglish = function() { return "Hello"; }; sayHelloInSpanish = function() { return "Hola"; }; Exporting a Module The utility of greetings.js increases when its encapsulated code can be utilized in other files. So let’s refactor greetings.js to achieve this goal




Flashcard 3963147652364

Tags
#unix
Question
Run the command and don't show StdOut and StdError
Answer
$[command] >> /dev/null 2>&1


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill






Flashcard 3963150273804

Tags
#unix
Question
Check if local server is listening on specific port
Answer
netstat -na | grep <port number>


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill