Understanding core global objects and NPM
Research:
Object 1. http:
http is a built in node module that lets Node transfer data over Hyper Text Transfer Protocol. It can also let you create an http server that listens to ports and then responds. You do this by defining that http is required, using the create server and request-response methods.
Object 2. events:
An event is basically any action from a computer. The events module lets you create, fire(trigger) or listen for your own events. You do this by requiring events and using the EventEmitter object.
Object 3. filesystem:
The node filesystem lets you work with the file systems on your Computer. You can read, create, update, delete and rename files using various methods.
Object 4. console:
Node console is a simple debugging console, which is very similar to the console provided by web browsers. The main difference is that node's console runs from the terminal instead of the browser. You can use similar commands on the node console like you would in the browser such as log, error, and warn. The global console is used to print to stdout and stderr. It can be used without importing any modules.
Object 5. buffer:
Buffer, from my understanding, is a way of handling binary data. Dev.to told me to think of a buffer like a data waiting room. You wait for enough data to fill up the room before slowly releasing the data out as a steady stream. Honestly buffers were a little difficult for me to understand, but I tried my best. Buffers have many different properties and methods that can create, copy, compare, check and return buffers. There are definitely more actions then that because there's a long listen
Object 6. globals:
Global objects are objects that are accessible in all modules. They're built in so they don't need any importing. one of these words is actually the word global. Defining something as "global" changes the scope of the variable so it will be accessible throughout the whole file
Object 7. Streams:
Streams are collections of data that don't have to be available all at once. They also don't have to fit into memory. They help you work with large amounts of data or data that's coming from somewhere else. There are 4 types of streams: readable, writable, duplex, and transform.
Object 8. url:
The url method allows you to parse urls into readable parts. It also allows you to construct new urls and access the different parts of a url.
Object 9: path:
The path module lets you work with directories and file paths. You can use it to construct, manipulate and work with file or directory paths. Some thing you can do are joining paths together, creating an absolute path, or returning a directory or file extension.
Object 10: os:
The os module is made to access information about the computer's operating system. You can get information about the os's name, release, platform, amount of free memory. Even information on their cpu's and it's architecture, or user info.
Object 11. process:
Process gives information about or control over current node processes. It's part of an EventEmitter, and emits events like exit, uncaughtException, and warning.
Feedback:
- How many hours did it take you to complete this assessment? (Please keep try to keep track of how many hours you have spent working on each individual part of this assessment as best you can - an estimation is fine; we just want a rough idea.)
Review/research 2hrs, coding 3 types: 1hr installing moment package: 15mins, coding using moment: 1hr (I had fun!)
- What online resources you have used? (My lectures, YouTube, Stack overflow etc.)
W3schools, dev.to, tutorialspoint.com, node.js’s website, Special coder’s YOutube video on moment.js
- Did you need to ask any of your friends in solving the problems. (If yes, please mention name of the friend. They must be amongst your class fellows.)
No
- Did you need to ask questions to any of your instructors? If so, how many questions did you ask (or how many help sessions did you require)?
No
- Rate (subjectively) the difficulty of each question from your own perspective, and whether you feel confident that you can solve a similar but different problem requiring some of the same techniques in the future now that you’ve completed this one.
I found the research time consuming but simple enough to do. W3Schools is my favorite resource. I can certainly find similar information again.
Coding each object file was fun. I especially liked that I could submit “wee woo” as valid homework. I will likely be able to do something similar again
I didn’t find installing the npm package too difficult, I chose moment because I struggle to work with dates. I find working with moment quite easy, especially after watching a tutorial video. I think I’d be able to do something similar with another npm package in the future
The biggest struggle I had was making github work. I clearly had no idea what I was doing during my database QAP. I basically submitted the zip file to github. I think I did much better this time around