The agile weblog of Sebastian Schürmann

Category: javascript

Weekly recap – Week #37

This week was code, code and code.

If you look for a way to generate a appcache.manifest and make your page more available for offline usage, grunt-appcache is your friend.

Manifesto is a anice bookmarklet to let you check HTML appcache manifests.

Using input fields with an TabletPC might pose ne challenges to event handling as I found out. Dismissing the virtual keyboard might break your layout.

Instead of using backbone and wondering about the amount of boilerplate to write, I might have a look into the new apper framework for single page apps. Nice one.

Math.js just got a 1.0 and I find the new filter feature very interesting. You might wanna check your js codebase for calculations that could be done with mathjs in a simpler way. Still I heavily recommend it.

Bootstrap your Express Project – A agile toolbox

When starting with a new node/express project there is a variety of tools available that help your development effort. I have started a new project and want to write down my recommendations for the tools to use.

TL;TR; You can clone a github repo here and start right away.And see the build status on travis

 NPM and package.json

Since you will have to manage dependencies in your node project, i advise you to start up with a package.json. This file contains the node modules you are using in your application. You might wanna exclude node_modules via the .gitignore file to avoid external node modules beeing checkied into git. You should now have a basic package.json file and a .gitignore file. Both need to be pushed to master right now.

A Blog Post about NPM and package.json


After you installed express.js via npm and your package JSON  you simply generate a Application Skeleton via the express command line tool. Now you have the skeleton application and push this to git. You might wanna add jade to your dependencies.

Express.js starter tutorial


Grunt helps you with linting your javascript files and orchestrate your general build. A grunt.js file in your projects root contains all the information that it needs to validate your project. To integrate it with npm aka npm test you can add a scripts.test property to your package json. Note that the npm grunt package is listed under the devDependencies property.

grunt.js docs


Mocha is a nice Unit Test framework. You want to use it for your TDD efforts. You can integrate this nicely into your grunt.js file to combine linting of js files and unit tests. Mocha and its commandos need a little tuning in the grunt.js template in order to make it stop complaining about unknown globals

Mocha docs


You mioght wanna test HTTP calls to your apps in a isolated way to check if not only your library code is working but your Webserver anwers with the right HTTP status codes etc.

Supertest Github repo

Travis CI

In order to let all your tests run as soon as you have pushed to your git you might wanna setup a travis ci build. Just connect travis to your repo and add .travis.yml file.

This is a superfast development chain that will help you to get superfast at implementing features into your app. The Setup time of ca. 20 Minutes will help a lot of time.

Travis setup docs for node.

You can clone a github repo here and start right away.