What is the filesystem module?
Allows you to work with the file system using node.js
require(“fs”);
What functions can the file system module perform?
What is the URL module?
Splits up a web address into readable parts
What is the url.parse() method?
Returns a URL object with each part
Ex:
q = url.parse(adr)
log(q.host)
log(q.pathname)
log(q.search)
What is the Node.js Crypto module?
Contains OpenSSL and allows you to encrypt and decrypt data
require(“crypto”);
How can you encrypt data with the crypto module?
How can you decrypt data with the crypto module?
What does the dns module do?
Can convert URLs to IP addresses and vice-versa
require(“dns”);
How do you convert a URL to an IP using the DNS module?
dns.lookup(URL, callback function (err, addresses, family));
How do you convert an IP to a URL using the DNS module?
dns.reverse(IP, callback function (err, url));
What does the events module do?
Allows you to create, fire, and listen for your own events
require(‘events’);
How can you access event properties and methods?
By creating an EventEmitter object
var emitter = new events.EventEmitter();
How do you assign an event handler to an event?
eventEmitter.on(event name, handler function);
How do you fire an event?
eventEmitter.emit(event name);
What does the timer module do?
Contains functions that can execute code after a certain period of time
What are the 3 scheduling timer functions available in the timers module?
What are the 3 cancelling timer functions available in the timers module?