node console standard output and more

In nodejs there is the console global that works much like the console global in web browsers that can be used to log the status of variables and messages in general to the javaScript console. The node console log method will print what is passed to it in the standard output with a newline after what is given as the first argument. There is also the standard error as well that can be logged to with the node console warn method. There are a few more things to be aware of when it comes to the node console global so in this post I will be going over some basics with it, as well as some other related topics.

Read More

lodash is a bunch of things

Lodash is a javaScript utility library based off another similar library known as underscore. There are many posts that have been written on what lodash is on the open web, and new posts continue to be written on the topic of course, present company included obviously. So with that said I thought I would take a moment to write my take on what lodash is. I guess there is what I can say about lodash when it comes to what it can be used for, what there is to work with in native javaScript by itself that is similar, why a developed should bother with lodash, as well as maybe why it should no loner be used actually.

There are actually a number of ways one could go about defining what lodash is aside from just a javaScript utility library. In this post I will be writing about some definitions when it comes to describing what lodash is, as there is more than one way to describe what lodash is to begin with before even getting started with lodash. I would say that lodash is often an example of a general utility library, but others might say it is a functional programing library, and so forth. So lets get to what lodash is all about then.

Read More

The nodejs native http request method

In nodejs there is the built in http module, this module can be used to set up a basic web server, but there are some additional features as well. One such feature is the http request method that can eb used to script http request from a nodejs environment. There are many options when it comes to having a server side http client, one of the most best known might be axios, but in this post I will be writing about just the plain old native JavaScript option in node today.

Read More

New Buffer from strings arrays and more in nodejs

The Buffer from method in nodejs can be used to create a new Buffer from a string, or array of numbers, or object in general. In many cases it might be one of th best ways to create a new Buffer, but there are other options as well of course. In any case when creating a nodejs project buffers do come up now and then, and the from method of the Buffer global comes in handy when there is a desire to quickly create a buffer with an initial value derives from a hex string for example. So lets take a quick look at some examples of the buffer from method in action in nodejs.

Read More