Learning Journey Node.js: thoughts on arrow functionsUp until this point in my career as a JavaScript/Frontend engineer, I've tried to just follow along with best practices as expressed via popular articles, library/package documentation, and any coursework I find myself leveling up with. I haven't typ...Mar 20, 2023 · 4 min readblog.thescrappy.dev
Learning Journal Node.js: printing in styleRather than trying to read through a sea of text that all looks the same, you can use a library such as chalk to style your logs in the terminal, so that the logs are both meaningful and easier to find. To do so, install chalk: npm install chalk Cre...Mar 20, 2023 · 2 min readblog.thescrappy.dev
Learning Journal Node.js: writing to filesOne of the ways to output in Node.js is to write directly to files in the local file system. One method that Node.js provides is fs.writeFileSync. This is a blocking method that appears to write string data to a given file, using the file name as a r...Mar 20, 2023 · 2 min readblog.thescrappy.dev
Learning Journal Node.js: blocking vs non-blockingFrom the Node.js official docs: "Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient." Blocking scripts require that execution happen sequentially. This is problematic for Node.js as new operations cannot be e...Mar 20, 2023 · 1 min readblog.thescrappy.dev
Learning Journal Node.js: import modulesQuestions Hello! Welcome to my day-to-day learning of Node.js. :) How do you import a 3rd party module into the JS file you're working with? How do you import your own JS file into the file you're working with? Does require syntax allow for named...Mar 20, 2023 · 3 min readblog.thescrappy.dev