GitterCLI, Wayfarer

Alex R. Young





apps browser routing chat

GitterCLI, Wayfarer

Posted by Alex R. Young on .

apps browser routing chat

GitterCLI, Wayfarer

Posted by Alex R. Young on .


I'm pleased to see that applications made with Blessed are starting to trickle into the DailyJS inbox! GitterCLI (GitHub: RodrigoEspinosa/gitter-cli, License: MIT, npm: gitter-cli) by Rodrigo Espinosa Curbelo is a Gitter client for the terminal. Those of us that are seasoned IRC veterans aren't too fond of web chat clients, and although Gitter has IRC access, GitterCLI could potentially take advantage of Gitter-specific features.

It uses the node-gitter module, and works using the standard HTTP authentication API implemented by Gitter. One thing I noticed was it drops authentication tokens into a "secrets" JSON file, and I couldn't work out if it checks to see if the permissions are safe (i.e., not readable system-wide). So you might want to check the secrets file when running it on a shared server. It stores the authentication token rather than your password, but naturally it still needs some level of protection.

Update: Corrected the GitHub URL.


Wayfarer (GitHub: yoshuawuyts/wayfarer, License: MIT, npm: wayfarer) by Yoshua Wuyts is a client-side router, a bit like react-router. Wayrarer is slightly different because it's a "method-less" router with an EventEmitter-inspired API and supports composition through mounting subrouters.

This is what the super-pretty ES6 syntax looks like:

const wayfarer = require('wayfarer')

const router = wayfarer('/404')

router.on('/', () => console.log('/'))  
router.on('/404', uri => console.log('404 %s not found', uri))  
router.on('/:user', (uri, param) => console.log('user is %s', param.user))

// => 'user is tobi' 

// => '404 /uh/oh not found' 

The combination of Wayfarer's API and fat arrow is very easy to follow, and the API should be easy to use with your other favourite client-side libraries.