Mike Feldmeier

Code from the void

Read this first

Manage processes with nproc

screenshot.png

So, after 30 years of “heavier” languages such as C++, Java, C#, I’m really liking Node.js as a change. Being able to prototype things quickly, having the server start up in sub-second times, and not being encased in a few hundred megabytes of virtual machine is pretty neat. I think the ecosystem has a lot of maturing to do before it moves from a “latest thing” to a true force to be reckoned with, but I think it will get there.

I’m presently developing on a 15" Windows 8 laptop. Definitely not the system of choice, but it gets the job done (and it’s light enough that my daughter can move it without dropping it). One of the things that it lacks is screen real estate. Alt-tabbing between windows can break that creative stride when you’re dealing with Mongo running in one console, an API server running in another, nodemon running your current codebase in a another, in addition to

Continue reading →


Yet Another Node.js Logger: femto-logger

femto.png

Ok, so I don’t know if we really need another logging framework, but after looking at various ones available in the registry, I found that I was implementing my own repeatedly, so I figured I would just stick it out there.

I had the goals of a logging framework that:

  • is dead simple to configure and use, with the configure part being optional
  • provides colorizing of different log levels
  • provides UTC-based timestamping with an ISO 8601 format for easy parsing
  • can be customized if desired
  • can use printf-style formatting for messages

The NPM package is here and Git project here.

Usage, as I mentioned, is dead simple:

var logging = require('femto-logger');

logging.info('Something happened.');

But, it can still be pretty well customized…

// Turn coloring on or off...
logging.config.coloring = true | false;

// Set debug color to bright cyan...
logging.config.colors.debug =

Continue reading →


Dynamically typed languages and Tolerant Readers

I’ve been playing around with Node.js for the past few months, and I must admit that I’m pretty hooked on it. Having lived in a statically typed world for the past 20 years, it can be a bit alarming to not be able to rely on the type of object that I’m receiving over the wire or from the database. I spent quite a bit of time trying force these objects into the paradigm that I’m used to working with. I had, of course, heard of duck typing, in which one queries the object for the attributes that they are interested in regardless of type, but it wasn’t a part of my thought process. As with most things, once I stopped fighting it, it became much more natural and easy to work with. While I still, to a certain degree, pine away for my package of well-defined domain objects, I can’t deny the power and beauty of being able to inspect, and even modify, the structure of one’s objects.

Martin

Continue reading →

no