As a Node.js Developer

I’m not a huge fan of JavaScript as a language but I’ve found Node.js to be a very productive and robust framework for building web services. This is in large part due to npm and the massive collection of available packages.

I tend to use Express if I am starting a new web service. Both Angular (MEAN) and React play well with Node.js web services running with Express.

I use bunyan for logging and use bunyan-cloudwatch when running in AWS to log events to CloudWatch directly. I use the AWS SDK for Node.js to connect to various AWS services like SQS. All of my Node.js web services or microservices use MySQL as a backend database.

I use web sockets heavily for facilitating real-time data synchronization. socket.io has worked well for this in Node.js. To ensure messages are broadcast to clients across all instances, socket.io-redis is used.

I write all of my JavaScript code using WebStorm, also by Jetbrains. I write my JavaScript with strict mode enabled and use eslint to automatically clean up my code.

As with iOS code, I write a lot of unit and integration tests for my Node.js web services. I use a combination of mocha and chai for writing tests and istanbul for code coverage. Again, this gives me the ability to safely update package dependencies more aggressively than would otherwise be possible.

In addition to normal web services, I also use Node.js to write microservices which run in AWS Lambda and are fronted by API Gateway. If I can, I use Swagger to document the API and to autogenerate the endpoints.

I used to use SendWithUs to create email templates, merge them, and send them out using SendGrid. I’ve since replaced all of the SendWithUs functionality with SQS and Lambda. SendGrid’s Event Webhook sends email-related events back to the web service so their events can be aggregated with other application and service events.

I’ve used a similar architecture to deliver several Alexa skills.