The JavaScript blog.


JSON node modules uuid

Node Roundup: HTTP DoS Fixed, Flocon, Trans

Posted on .

Node DoS Fixes

This week two maintenance releases of Node were rolled out to fix a DoS vulnerability in the HTTP module.


I seem to find myself generating a lot of unique IDs lately. Flocon (GitHub: Yosee / flocon, License: MIT, npm: flocon) from Yosee is a 64-bit unique ID generator, written in C++. It's currently considered experimental by the authors but comes with unit tests.

Flocon returns IDs synchronously as strings with flocon.snow(), and the algorithm used is based on Twitter's Snowflake service.

There are also some benchmarks of the flocon module so you can compare it to other projects.


Gabriel Adomnicai sent in "trans" (GitHub: gabesoft / trans, License: MIT, npm: trans), a module for transforming objects. Given some JSON, trans can group and modify objects by using a chainable API:

var trans = require('trans');  
var data = [  
  { a: { b: 'fbc' }, c: 1 }
, { a: { b: 'foo' }, c: 3 }
, { a: { b: 'fde' }, c: 2 }
, { a: { b: 'def' }, c: 3 }
, { a: { b: 'ghk' }, c: 4 }

  .group('a.b', 'c', ['charAt', 0], 'toUpperCase')

[ { key: 'D', value: [ 3 ] },
  { key: 'F', value: [ 1, 2, 3 ] },
  { key: 'G', value: [ 4 ] } ]

Each of the methods is documented in the readme, and Gabriel has included tests as well.


JSON mac node modules windows uuid

Node Roundup: 0.10.7, JSON Editor, puid, node-mac

Posted on .

You can send in your Node projects for review through our contact form.

Node 0.10.7

Node 0.10.7 was released last week. This version includes fixes for the buffer and crypto modules, and timers. The buffer/crypto fix relates to encoding issues that could crash Node: #5482.

JSON Editor Online

JSON Editor Online

JSON Editor Online (GitHub: josdejong / jsoneditor, License: Apache 2.0, npm: jsoneditor, bower: jsoneditor) by Jos de Jong is a web-based JSON editor. It uses Node for building the project, but it's actually 100% web-based. It uses the Ace editor, and includes features for searching and sorting JSON.

It's installable with Bower, so you could technically use it as a component and embed it into another project.


Azer Ko├žulu sent in a bunch of new modules again, and one I picked out this time was english-time (GitHub: azer / english-time, License: BSD, npm: english-time). He's using it with some of the CLI tools he's written, so rather than specifying a date in an ISO format users can express durations in English.

The module currently supports milliseconds, seconds, minutes, hours, days, weeks, and shortened expressions based on combinations of these. For example, 3 weeks, 5d 6h would work.


puid (GitHub: pid / puid, License: MIT, npm: puid) by Sascha Droste can generate unique IDs suitable for use in a distributed system. The IDs are based on time, machine, and process, and can be 24, 14, or 12 characters long.

Each ID is comprised of an encoded timestamp, machine ID, process ID, and a counter. The counter is based on nanoseconds, and the machine ID is based on the network interface ID or the machine's hostname.


node-windows provides integration for Windows-specific services, like creating daemons and writing to eventlog. The creator of node-windows, Corey Butler, has also released node-mac (GitHub: coreybutler / node-mac, License: MIT, npm: node-mac). This supports Mac-friendly daemonisation and logging.

Services can be created using an event-based API:

var Service = require('node-mac').Service;

// Create a new service object
var svc = new Service({  
  name: 'Hello World',
  description: 'The nodejs.org example web server.',
  script: '/path/to/helloworld.js')

// Listen for the "install" event, which indicates the
// process is available as a service.
svc.on('install', function() {  


It also supports service removal, and event logging.