The JavaScript blog.


libraries knockout articles lo-dash

Lo-Dash v3, g5-knockout.js

Posted on .

Harder, Better, Faster, Stronger Lo-Dash v3

I've noticed that Lo-Dash is a popular module on npm, and it's recently had a major release for version 3.0. This version brings some new features and interesting internal changes.

Gajus Kuizinas sent in Harder, Better, Faster, Stronger Lo-Dash v3, a post that explores version 3, like lazy evaluation, pipeline computing, deferred execution, and newly available methods.

Version 3 is the biggest update to Lo-Dash ever3. With ever increasing user base, modular code base, and cross-browser compatibility, Lo-Dash is the go-to utility library for years to come. With that in mind, there is an going competition with lazy.js and undescore.js, both of which are in active development.

Knockout/Browserify Base App with Events

Working with Knockout and Browserify is a pretty solid choice for many client-side projects, but because these are libraries rather than frameworks you need to know what you're doing before getting started. Greg Babula has created g5-knockout.js which you can use as a foundation for your next MVVM project. It includes an event bus for decoupling, and this is based on Node's events module, which is made possible thanks to Browserify. I also noticed Greg uses Lo-Dash.

Greg included a blog post in his submission which explains the concept and decisions behind the main dependencies. You can look at the source to see things like how view models are made.


node apps modules npm express mvc knockout

Node Roundup: Bedecked, Knockout.sync.js, express-promise

Posted on .


Who wants to write presentations in Keynote or PowerPoint? No one! That's why Justin Russell made Bedecked (GitHub: jtrussell / bedecked, License: MIT, npm: bedecked):

A small module for quickly and simply authoring snazzy presentations in Markdown - or Jade, or vanilla HTML. Inspired by hackynote (thiagofelix/hackynote), Bedecked splits your Markdown into slides and spits them out as a single html file that you can share with Dropbox, S3, or whatever you like.

The command-line tool allows you to transform Markdown files into presentations. It uses stdout, so you can redirect the output into a .html file.

It can also run as a server which supports live reloading.


Knockout.sync.js (GitHub: imrefazekas / knockout.sync.js, License: MIT, npm: knockout.sync.js) by Imre Fazekas adds syncing to Knockout, supported by a Node server. This allows data to be persisted to a server and shared between clients as desired.

Timestamps can be used to allow clients to respond to outdated data, and Socket.IO is used in the client.


express-promise (GitHub: luin / express-promise, License: MIT, npm: express-promise) by Zihua Li is middleware for folding repetitive asynchronous operations into leaner synchronous-style operations.

This is the kind of thing you're probably used to writing:

app.get('/users/:userId', function(req, res) {  
  User.find(req.params.userId).then(function(user) {
    Project.getMemo(req.params.userId).then(function(memo) {
      res.json({ user: user, memo: memo });

But with express-promise you can do this:


app.get('/users/:userId', function(req, res) {  
    user: User.find(req.params.userId),
    memo: Project.getMemo(req.params.userId)

The readme has more documentation, with examples for Mongoose and Sequelize.


jquery testing plugins keyboard knockout paste

jQuery Roundup: QUnit 1.11, Knockout-jQueryUI, Tab Override, FilteredPaste.js

Posted on .

Note: You can send your plugins and articles in for review through our contact form.

QUnit 1.11

There's a good post on the official jQuery blog about a change in direction to the QUnit project: QUnit 1.11 Release: A Look Back (and Forth). It discusses some of the history behind QUnit, and includes a survey where you can share how you're using it.


Trying to integrate libraries like Knockout is sometimes confusing when you're already using jQuery UI. To address this, Vas Gábor has created Knockout-jQueryUI (GitHub: gvas / knockout-jqueryui, License: MIT), which is a collection of Knockout bindings for jQuery UI widgets.

It's small, comes with a build script and unit tests, and the author has provided full documentation on the project's homepage.

Tab Override

Tab Override (GitHub: wjbryant / taboverride, License: MIT, bower: taboverride) by Bill Bryant allows the tab key to insert tabs in textarea elements. It also supports auto indent and multi-line tab insertion.

There's also a jQuery Tab Override plugin, and both scripts are AMD-compatible. Bill has included QUnit tests, which actually simulate key presses to test the script's various features.


FilteredPaste.js (GitHub: willemmulder / FilteredPaste.js, License: CC BY-SA 3.0) by Willem Mulder can be used to filter text when it's pasted into textarea elements, or anything with the contenteditable attribute. Why is this useful? Well, Willem got tired of dealing with support requests when text pasted from Word into his CMS carried across unwanted formatting.

I find myself always using Paste and Match Style and wondering why this isn't the default for the paste keyboard shortcut. The only time I've ever wanted to include formatting when pasting is when I make slides in Keynote/PowerPoint/Google Drive and want to include syntax highlighting in my examples. And that seems like an edge case if ever there was one!