module.exports early, a simple pattern

Here's a very quick blog post about a pattern I started to use some time ago when creating node.js modules. I often see code like this: var func = function() { } var otherFunc = function() { } var working = 'yes'; // // dozen of functions // and at line 150.. module.exports = someFunc; What's wrong? Well I…

Read More

why I use function declarations and named functions

How do we define functions theses days ? var hello = function() { console.log('hello') } function hello() { console.log('hello') } obj.hello = function() { console.log('hello') } The first and third examples are anonymous functions stored in variables (first example) or inside a property (third example). What's wrong with that? anonymous functions are…

Read More

secret productivity tips for developers

I hope to get a lot of rage comments with this title because there is no need for secrets when coding. troll intro While coding, do you sometimes look like this? The tricks you will learn here will make you type like this: LET'S GO! almost serious intro Like any…

Read More

headless chrome and firefox in selenium with docker

Selenium automates browsers. That's it. What you do with that power is entirely up to you. Not a lot of people likes selenium, because: it's hard to install it seems unstable it's old (and thus not very attractive) Getting the selenium installation right on every developper environment can be very…

Read More