background preloader

Karma - Spectacular Test Runner for Javascript

Karma - Spectacular Test Runner for Javascript

Export This: Interface Design Patterns for Node.js Modules | Bites from Good Eggs When you require a module in Node, what are you getting back? When you write a module, what options do you have for designing its interface? When I was first learning to work in Node I found the sheer number of ways to do things to be a bit overwhelming. JavaScript is extremely flexible and the community of developers contributing to open source seem to have different styles for implementing the same thing. On my journey with Node I've been keeping an eye out the Good Way to do things and adopting them for use in my own work and in our work at Good Eggs. In this post I'll share my observations of the Node module system and the ways in which you can use it to encapsulate and share code. I discuss seven patterns below, many of which can be used in combination. require, exports and module.exports First some fundamentals. In Node requiring a file is requiring the module it defines. It's as if there were an implicit line at the beginning of each module that reads: and require it with: Export Away!

test Migrating from 2.x to 3.x · visionmedia/express Wiki Removed Changed req.header(field[, defaultValue]) replaced by req.get(field) (remains for backwards compatibility)res.header(field[, value]) replaced by res.set(field, value) / res.get(field) (remains for backwards compatibility)renamed app.register() to app.engine()template engine compliance from engine.compile(str, options) => Function to engine.__express(filename, options, callback)express.createServer() is now simply express() (but remains for BC). Keep in mind that the return value of express() is no longer an http.Server instance. (See the Application function section below for more details) View options Application function The return value of express() is a JavaScript Function, encapsulating everything that makes an Express app tick. ...var app = express();http.createServer(app).listen(80);https.createServer(options, app).listen(443); For convenience, and smaller applications the app.listen() method takes the same arguments, wrapping in an HTTP server. and Socket.IO compatibility

Blanket.js | Seamless javascript code coverage jade templating engine micro web framework MVC How To Node - NodeJS s'interface bien avec Github , Moka The Node Beginner Book » A comprehensive Node.js tutorial Tutorials Hosting Node.js and MongoDB After digging into web development with Node.js the last couple of months I had to choose where to host this blog, which I had decided to rewrite and run with Node as a result of my research. To be honest, I’ve been surprised there is no real ecosystem of (shared) hosting providers offering Node.js and MongoDB (which often is the obvious choice when developing a node application) on the cheap. There are some providers like nodejitsu for Node.js and mongolab for MongoDB - but there is no fully integrated experience as you would expect it coming from the LAMP world or even ASP.NET. So it seemed to be a Do-it-yourself-world. Challenge accepted! Requirements My personal requirements were: Run Node.js and MongoDB (or any other database) side-by-side. Option 1: Run your own physical machine I always trusted Hetzner as their dedicated servers are not only cheap but also powerful and reliable. Hetzner also offers free 100 GB backup space for each dedicated server. Conclusion

IDE Premiers pas avec Grunt Nous vous conseillons aujourd’hui d’utiliser un gestionnaire de tâches qui nous paraît être mieux sur bien des points: configuration plus souple, lisible et facile et rapidité vous attendent avec Gulp. Vous avez sûrement déjà entendu parler de Grunt à droite à gauche, en conférence, voire votre boite l’utilise déjà mais vous ne savez toujours pas trop ce qui se cache derrière ce terme saugrenu digne d’un personnage de Warcraft. Soit, ce n’est pas bien grave. Vous est-il déjà arrivé de devoir régulièrement lancer, lancer et relancer des processus tels que Sass, LESS, uglify - en somme des préprocesseurs ou des minifiers - régulièrement à la main ? Voici un workflow assez classique : Compiler mes .scss en .css;Concaténer mes *.js en un seul fichier;Minifier (avec uglify par exemple) la résultante de l’action précédente. Voyons maintenant comment l’on peut mettre en place ceci via Grunt. # Installation Tout d’abord, installons Grunt. $ npm init $ npm install -g grunt-cli # Initialisation Fait ?

si besoin automatiser la création de projets,

Related: