Winston

Using Winston, a versatile logging library for Node.js

Today, we will explore Winston, a versatile logging library for Node.js. Winston can be used in numerous contexts including in Node web frameworks such as Express, and Node CLI apps. We will also dive into features that make Winston a good fit for IoT applications such as logging timestamped entries to files. This article has been updated to reflect the latest generation of Winston at the time of this writing which is Winston 3.x.

Share

Node.js Learning through Making – Build a CPU Sensor

We are back with our LTM (Learning through Making) tutorials and ready to hit the ground running and write some real Node.js code!  In this series, we will learn about Node.js in the context of creating IoT (Internet of Things) projects.  We will build a “CPU Sensor” in this first project since CPU loading/utilization is a “sensor” we can measure, record, and ultimately stream to other locations.  In future tutorials, we will harness the power of Node.js to interact with physical sensors that live outside of our computing environment.

Share

Node Newbie Error – NPM Refusing to Install Package as a Dependency of Itself

I encountered an error and thought I’d post the solution here since it just might happen to you sometime!  Here’s the scenario: I was planning to take the winston npm module out for a spin to try out it’s awesome logging capabilities.  I created a directory called winston to create a project and conduct the test.  What would be more logical than that?  🙂 Next, I ran npm init to create a package.json file hitting my Enter key as fast as it could go to accept all the defaults for this throwaway test project:

Share