hello.js

var please = require('share');
console.log('thank you');

NEW !!!

Tuesday, 26 July, 2016 UTC

The Fastest Way For A Coder To Get Fired

What do you mean, “ why are the websites down? ” – I asked as I turned to look at my boss, in confusion. “They’re not down.“ “See, they’re …” … WHAT?! It was the early 2000’s and I was nervous about what I had built – a new and ambitious application ... more


Friday, 24 June, 2016 UTC

Currying: A Functional Alternative To fn.bind

In my quest to learn functional programming with JavaScript, I seem to have been focusing on the idea of currying – taking a function that expects more than one argument, and turning it into a series of functions that only take one argument, executing ... more


Monday, 16 May, 2016 UTC

Custom Errors w/ Clean Stack Traces in Node.js

Some recent discussion in the WatchMeCode slack spawned a bit of research into creating custom errors through factory methods, while keeping the stack trace for those errors clean, in Node.js After a bit of digging, I found a good solution using Node’s ... more


Monday, 9 May, 2016 UTC

In What Order Does My Express.js Middleware Execute?

I recently had a conversation in the WatchMeCode slack where someone was asking about the order in which various parts of Express middleware would fire. After some initial thoughts on the question, I found myself not 100% certain of the order between ... more


Friday, 6 May, 2016 UTC

JavaScript’s “new” vs Object Literals: Performance Implications

If it’s faster to use object literals or other forms of object creation in JavaScript, why would anyone use the “new” keyword and constructor functions? Does it make a difference when it comes to the application performance vs the readability and expressed ... more


Monday, 2 May, 2016 UTC

URI/URL Encoding Strings In JavaScript/Node.js

I recently found myself needing to URL encode a string, in Node – to convert a space into %20 in this case, but also to handle other scenarios. My initial thought was “oh, great – I’ll need to find a library that doesn’t completely suck”. Turns out I ... more


Friday, 22 April, 2016 UTC

The Secret To Building Large JavaScript Apps

Have you ever wondered what the real secret to writing large apps – especially JavaScript apps – may be? Perhaps you think about a skyscraper in a large city; a monolithic thing, self-sustaining and yet connected to the parts around it? In this episode ... more


Wednesday, 20 April, 2016 UTC

Optional Folders In Express.js Routes

I recently found myself needing to support an unknown URL folder structure with an Express router. The gist of it is that I am serving video files that may or may not be in a sub-folder, from another service. For example, I need to have all of these ... more


Monday, 18 April, 2016 UTC

The High Barrier To Entry For ES2015 (ES6)

It’s no secret that I’m a fan of various ES6 features. I use a lot of the new syntax options and methods on various objects whenever I can – in browser based apps as well as node.js apps. But I recently stumbled upon on a situation that had me wondering ... more


Monday, 4 April, 2016 UTC

Develop Against Local Node Modules, Deploy From npm or Github

Using a module that’s hosted in npm or on github is fairly easy. You can “npm install” or just update your package.json file with the github location and be done. But what about developing locally? How do you get your code from a module that you are ... more


Wednesday, 30 March, 2016 UTC

Why Messaging? Why Not Have The Web Server Handle The Request?

A reader of my RabbitMQ Patterns email course recently asked a question about using messaging systems within an web application. Specifically, they wanted to know why you would use a request/reply pattern over a messaging server, instead of just handling ... more


Wednesday, 23 March, 2016 UTC

Get A Data-Attribute Value From The Selected DataList Option

A few months ago, I stopped writing AJAX-style auto-complete inputs on my web apps. Instead, I started using the HTML5 DataList feature. It’s a pretty simple, and fairly slick way to do auto-complete on an input text box (as long as your list isn’t too ... more


Tuesday, 22 March, 2016 UTC

Giving TestDouble.js A Spin, For Better Mocks In Jasmine Unit Tests

A friend of mine, Justin Searls, recently released a project that he and his team have been working on for a while, to replace both sinon.js and the built-in jasminebdd mock / spy tooling. The project, TestDouble.js (apparently named after his company, ... more


Wednesday, 9 March, 2016 UTC

Creating A True Singleton In Node.js, With ES6 Symbols

In Node.js, it’s common to use “module.exports” to export an object instance, allowing other files to get the same object instance when requiring the file in question. A lot of people call this the singleton pattern of Node.js, but this isn’t really ... more


Wednesday, 2 March, 2016 UTC

5 Tips To Improve Your JavaScript w/ ES2015 (ES6)

I’ve done a lot of work with ES6 in the last 6+ months, and I’ve found that while I do still have a lot of questions about some of the new features and syntax, there are some parts that a big win for everyone, right now. To illustrate the parts that ... more


Monday, 29 February, 2016 UTC

Find An Item By Property, In An Array, Without Using ES6 Methods

A reader recently sent me an email, asking a question about how to find an item in an array, based on a property / attribute that would match. Meaning, the object instance will be different, but the attribute (such as “id”) will be the same. This person ... more


Monday, 22 February, 2016 UTC

How I Stopped Worrying and Learned To Love WordPress

I’ve been running WordPress on various blogs for a few years now. Prior to that, I’ve tried out several different solutions for blogging and other needs that WordPress can fulfill. While I think WordPress as a whole, leaves a lot to be desired, I also ... more


Wednesday, 17 February, 2016 UTC

Using Express Sub-Apps To Keep Your Code Clean

Express is one of the most flexible web hosting libraries I have used in my career. I love how simple it can be, and how it allows you to grow your system as needed. One of the areas that has continued to bother me in my own code, though, is my lack ... more


Monday, 15 February, 2016 UTC

What Do You Name The Callback Function?

JavaScript practically requires callback functions to do anything asynchronous. Unless you’re talking about generators, you really can’t get away from them. Callbacks are everywhere. But someone recently asked a question about naming callback methods: ... more


Wednesday, 10 February, 2016 UTC

A Conversation on Patterns, Practices and System Architecture in Node.js

In my last post, I talked about how I see folding code regions as an anti-pattern as a design error in code. That post was inspired by a conversation I’ve been having via email, and that conversation has taken a rather interesting turn. It started as ... more


Wednesday, 3 February, 2016 UTC

I Know I Don’t Need This Test, But …

I was all set to npm publish the next version of my Rabbus library. All my tests were passing, and everything was good to go. Then I decided to write just one more test… just in case. I mean, the code works fine. I don’t need to write this test. I know ... more


Monday, 1 February, 2016 UTC

Some JavaScript Book Recommendations

There’s no shortage of JavaScript books available, these days. Nearly every tech publisher has a book covering just about every aspect of the language, the latest frameworks and the tools that you need to be looking at for the future. But this massive ... more


Monday, 25 January, 2016 UTC

Patterns Of Crochet and Code

A few months ago (fall of 2015), my 6 year old daughter saw a crochet kit at a bookstore. It was the kind of kit that comes with a crochet hook, yarn and a book of patterns. There’s enough yarn to create two small projects and hopefully get you started ... more


Monday, 4 January, 2016 UTC

Route Specific Error Handlers In Express Apps

A WatchMeCode subscriber recently asked a question about error handlers with Node and Express. In his scenario, the subscriber wants to have a series of routers to handle requests to /api. Within these routes, he wants a generalized error handler that ... more


Monday, 14 December, 2015 UTC

Which F Is The IIFE?

A WatchMeCode subscriber recently emailed a question regarding some code in my Variable Scope episode (part of the JS Fundamentals series). In her question, she points out some code from the episode, wondering if it is still considered an Immediately ... more


Monday, 7 December, 2015 UTC

A Telegraph To The Future Of Web Apps

At the Nodevember 2015 conference, I gave a talk titled “A Telegraph To The Future Of Web Apps”. This talk is very much the “why to” of human communication, messaging in software, and how software reflects the way we work together. The Nodevember conference ... more


Wednesday, 18 November, 2015 UTC

Finitely Iterating Infinite Data With ES6 Generators

ES6 generators provide a new way of working with data that should be iterated. In fact, generators produce an iterator when you initially call the generator function. One of the things that you can do with a generator, that might not be obvious, is iterate ... more


Monday, 16 November, 2015 UTC

Kill .apply With The …Spread Operator

A question was asked in a conversation about ES6 recently, about the real use of the ES6 spread operator. This person wanted a slightly better explanation than they had seen previously, as they weren’t yet sure of where this new operator was really useful. ... more


Monday, 9 November, 2015 UTC

How Does A JavaScript Function Define A Type And Create Object Instances?

I recently received a question from someone going through my Mastering JavaScript “this” email course, regarding day 3 of the course, where I talk briefly about constructor functions and the “new” keyword. In this course, I say: The value of “this” inside ... more


Monday, 2 November, 2015 UTC

Handling Request/Reply Timeouts With RabbitMQ, Node and Promises

In my RabbitMQ Patterns For Applications (email course / ebook), I talk about how you should limit the amount of time allowed for a Request/Reply scenario: The typical use case for a request/response scenario is to retrieve data that a user needs to ... more