The super simple http client for making requests in node.js called simply request

In many node.js projects it is necessary to grab resources that may exist on some kind of external source. In general often you may just need to get what is there, just a simple get request, and thats it. It would also be nice to use some kind of package that helps to make it stupid easy, for this there is a popular npm package simply called request. request is one of many http clients that are available for a node.js environment, another popular such package would be axios. There is also not bothering with any npm package at all, and using a built in nopde.js module like that of http. However for the sake of this post I will be keeping the focus on request.

Read More

Making a Hexo.io tag that gets JSON data with an httprequest

I have written a post on hexo.io that outlines how to go about making a hexo tag that gets data from an async file read. Sometimes I might want to write a tag that gets data that is to be used to generate content in a page by way of an async http request. In this post I will be outline how I found a way to go about doing just that. However lately I have found that this is something that I should try to avoid doing actually. In think that hexo should just be used to build from a source folder, and maybe not have much to do with generating that source.

Read More

Getting started with canvas basics

I thought it would be nice to write a few blog posts on the html 5 canvas element that can be used to create raiser graphics, animations, user interfaces, and games in a client side javaScript environment with a little code. Mainly just some posts on doing some fun things with the 2d drawing context, but also some topics on game development, animations, and anything else that might come up when it comes to the basics of canvas elements, javaScript, and beyond.

As such maybe it is best to start with a post that is a kind of getting started post on the subject of canvas elements and with that to some extent at least client side javaScript. That is because in order to do anything interesting with canvas, at least some basic working knowledge of javaScript is also required. So lets get this getting started post out of the way so we can get to more interesting topics, and actual full canvas examples that really help to show off what canvas is really all about.

Read More

Deleting a collection of files recursively with rimraf

Some times I might want to delete a whole bunch of files that exist in a file system structure on the host operating system of a script that will run on top of nodejs. If the project I am making is aways going to be running in a POSIX environment, I could use the rm command with a child process, but say I want to make the app more portable and work okay in a win32 environment also. This is where something like the npm package rimraf may come in handy when it comes to making use of what there is to work with in user space.

Read More