DailyJS

DailyJS

The JavaScript blog.


Tagconsole
Featured

libraries console node apps modules npm iojs

Node Roundup: TJ Steps Down, Node and io.js Performance, Cloud Commander, Blessed

Posted on .

TJ Steps Down

Timothy J Fontaine has stepped down as the leader of the Node project:

Given the strength of its community, I'm confident that Node.js is heading in the right direction. With that said, it's time for me to step back.

The formation of the Node.js Foundation couldn't have happened at a better time in the life of Node.js. I believe this will be the tipping point that cements Node's place in technology. Soon, the foundation will be announcing its first meeting, initial membership, and future plans for Node.js.

The announcement includes details about Julien Gilli's work on the project, who is paid as a full-time developer on Node itself:

Julien has been responsible for the last few releases of Node.js -- both the v0.10 and v0.12 branches.

Thanks to him, we were able to ship v0.12.0 with all our tests passing and on all of our supported platforms. This was the first Node.js release ever to have that feature.

There's also another post on the Node blog by Scott Hammond that reiterates the move towards the Node.js Foundation:

Under the aegis of the Foundation, the Node.js project is entering the next phase of maturity and adopting a model in which there is no BD or project lead. Instead, the technical direction of the project will be established by a technical steering committee run with an open governance model.

That all sounds promising, except most of us just want a Node that has ES6 features without flags and continued updates to the V8 core. Naturally that brings me to io.js which just hit version 2.0.1. This release updates libuv and V8, and has fixes for async-wrap, documentation, and some of the internal C++ in the src/ folder. And you may also remember that the io.js 2.0.x branch has enabled lots of ES6 features without flags.

Node and io.js Performance

Nick Harley sent in Performance Showdown: Node.js vs. io.js v2.0.0:

A 14.8% speedup from Node to the latest version of io.js - certainly worthy of note. If you’re looking at one of the latest generation of JS backend frameworks, it certainly pays to give io.js a look as out-of-the-box you get some rather impressive perf improvements. When running a cluster of VMs using the Node stack, depending on scale, that speedup may result in several fewer boxes needed and correspondingly less infrastructure costs - all for free.

Cloud Commander

Coderaiser sent in Cloud Commander (GitHub: coderaiser/cloudcmd, License: MIT, npm: cloudcmd), a Node app that's been under active development since 2012. It's a file manager that reminded me of a web version of Midnight Commander, and it bundles CodeMirror and Ace so you can edit code with it quite comfortably.

It's built with Express and Socket.IO, and I was pleased to see they're on Express 4.x. The documentation the homepage includes details on how to deploy it with a non-root user for Linux/iptables or nginx.

The web app has a console interface as well, so you can type commands rather than using the web GUI.

Blessed and Blessed-Contrib

A colleague kept telling me how good Blessed-Contrib was, and I've only briefly mentioned Blessed on DailyJS before so I wanted to mention it. The attached gif illustrates why. Blessed is a curses-like library, but it has a very high-level API that I find much easier to understand than most terminal GUI libraries.

However, the magic really happens when you get blessed-contrib:

Blessed-Contrib

I've been waiting for something like this for years but never found a high-level scripting language library good enough to make my 1980s Unix console UI fantasies come true. Now I can finally bring to life my W.O.P.R version of our status dashboard!

Featured

libraries console logging modules

Logdown: Generate Logs with Markdown

Posted on .

A few years ago, Firefox and Chrome added support for styles to log messages. This means you can call console.log with an additional CSS option. I've noticed a few libraries and frameworks using this to good effect for debugging messages, but an idea that's new to me is combining Markdown with logging.

Logdown (GitHub: caiogondim/logdown, License: MIT, npm: logdown) by Caio Gondim is a module that lets you include Markdown in logs for both the browser and server. It can do the basics, like italic and bold, but the thing that I really like is including code.

To use it, instantiate a new Logdown instance, and then just log as you would with console.log:

var Logdown = require('logdown');  
var debug = new Logdown({ prefix: 'foo' });

debug.log('lorem *ipsum*');  
debug.info('dolor _sit_ amet');  
debug.warn('consectetur `adipiscing` elit');  

The module supports various options: you can turn off Markdown parsing and add a prefix. It supports Node 0.10+, io.js 1.0+; and Chrome, Firefox, IE 9+, Opera, and Safari 8.0+.

Featured

console github fsm

Red Dwarf, Stately.js, ansi_up

Posted on .

Red Dwarf

Red Dwarf

Red Dwarf (GitHub: rviscomi / red-dwarf, License: MIT) by Rick Viscomi is a heat map visualisation of GitHub repository stars. It can display stars for a specific repository, so the joyent/node heat map is pretty interesting given the sheer amount of stars it has.

Google Maps is used for geocoding and displaying the map, and GitHub supplies the raw data. Both of these APIs are accessible with client-side JavaScript, so the whole thing can work purely in-browser. The visualisation itself is drawn using Heatmap Layer, provided by Google Maps.

Stately.js

Stately.js logo

Stately.js (License: MIT) by Florian Schäfer is a finite-state automaton engine, suitable for use in client-side projects. Given that most of us are used to working with events, state machines work quite naturally in JavaScript. Stately.js allows transitions to be tracked using notifications, and handlers can be registered and removed as required.

Florian's documentation is detailed, and the "door" example is an easy one to follow if you're confused about how the project can be used. Some simple tests have also been included, with a small HTML test harness.

ansi_up

ansiup example

I still hang out in IRC, and I still like using Mutt for email. There's something reassuring about the glare of colourful text-based interfaces that no GUI will ever replace. If you're a fellow console hacker, then you may find a use for ansiup (License: _MIT, npm: ansi_up) by Dru Nelson. It converts text with ANSI terminal colour commands into HTML, so you can take your FIGlet-powered nonsense to the web and annoy people with it there.

Dru says this project has been used "in production" since early 2012 -- I wonder what it's being used for?

Featured

frameworks server console node

Node Roundup

Posted on .

Welcome to the Node Roundup. Send in your apps and libraries using our
contact form or @dailyjs.

Node 0.2.4

Node 0.2.4 was released
on Sunday. This version includes:

  • --eval in command line options
  • Net-related fixes
  • --max-stack-size flag

Download it from
nodejs.org, and for 0.2.4-specific documentation bookmark this:
http://nodejs.org/docs/v0.2.4/api.html

node-ncurses

Ncurses is something of a nemesis of mine. Working with Ncurses is
probably the least fun I've ever had programming, and I've written a
fair bit of Ada in my time. Last week I mentioned Node FFI, which made
me wonder if anyone would knock up a quick Ncurses binding, but then I
found an existing one called
node-ncurses.

Ncurses refers to "New Curses", it's an emulation layer for curses that
uses Terminfo and a bunch of other stuff so you can make text-based
interfaces. If you've ever used mutt, irssi, or lynx you'll know what I
mean.

The author has documented the entire API in the readme, it looks a lot
like C Ncurses from what I remember of it. The examples demonstrate the
API:

var nc = require('../ncurses'), consts = require('../ncconsts');

var win = new nc.ncWindow();
win.print("Max number of colors supported by this terminal == " + win.numColors + "\n");
win.print("Max number of color pairs supported by this terminal == " + win.maxColorPairs + "\n\n");
win.print("White on black\n");

You might think I'm joking about Ncurses being my nemesis, but every
time I run the node-ncurses examples I get kernel
panics
!

The author Brian has a blog where he writes about Node, so you may like
to check it out: mscdex.net

Wilson

Wilson by Chris Dickinson is a Django-style Node framework. There's an example
app
that uses
postgres and
documentation at readthedocs.org. If you look at Dickinson's other
projects
you can see he's created
quite a few that draw on ideas from Django.

Featured

server tools console

Jake

Posted on .

The creators of Cappuccino recently announced
that it has gone 100% JavaScript. The motivation for this was that the
build chain contained dependencies on Ruby, which worked well but was
problematic for contributors who aren't familiar with the language.

Jake is what made this possible. Based on Rake, Jake is a build tool. If
you're not familiar with Rake or make, they're used to
invoke scripts that piece together large software projects.

Rake is so flexible that people often use it for tasks that would be
traditionally performed with a shell script -- the benefit is code reuse
from other parts of the project. I use Rake for running tests, scripting
deployment, getting stats from servers, and all kinds of housekeeping
routines.

Now you can do all of this from JavaScript.

Jake uses task functions that look like Rake tasks:

var task = require('jake').task
task('hello', function() {
  print('Hello World')
})

Introducing Jake: A Build Tool for JavaScript
contains more information to get you started.