Gergely Nemeth sent in From AngularJS to React: the isomorphic way, which outlines how his company used React, Flux, and Koa to reuse code in the browser and on the server. The server-side code is capable of generating a Flux-React application instance and then rendering views.
The browser loads the same code (built with Browserify/Webpack) and bootstraps the application from the shared state. (shared by the server and injected into the global/window scope). This means that our application can continue from the point where the server has finished.
It seems like a lot of people struggle to share code this way, so it's interesting to see how the author's Angular experiences compared with React.
Jos de Jong sent us an email to say Math.js has been updated to version 1.0. The project now has more tests and BigNumber support.
You can create BigNumbers with strings, like this:
precision: 20 // Number of significant digits for BigNumbers
math.bignumber('1.2e+500'); // BigNumber, 1.2e+500
I want to thank the community for all valuable and constructive feedback and discussions. Without them, I don't think we would have had an API so elegant and consistent as it is now. I'm looking forward to the coming period, implementing more great features, making math.js better and better.
Cytoscape.js (GitHub: cytoscape / cytoscape.js, License: LGPL, npm: cytoscape), developed at the Donnelly Centre at the University of Toronto by Max Franz, is a graph library that works with Node and browsers. This library is for working with "graphs" in the mathematical sense -- interconnected sets of nodes connected by edges.
Styling graphs is also handled in a natural manner:
Graph style and data should be separate, and the library should provide core functionality with extensions adding functionality on top of the library.
Max and several contributs have been working on the project for two years now, so it's quite mature at this point. The project comes with detailed documentation, a build script, and a test suite written with QUnit.
It has no dependencies and is compatible with the built-in Math library. One feature I particularly like is the expression parser:
var parser = math.parser();
parser.eval('1.2 / (2.3 + 0.7)'); // 0.4
parser.eval('a = 5.08 cm');
parser.eval('a in inch'); // 2 inch
parser.eval('sin(45 deg) ^ 2'); // 0.5
This opens up some interesting possibilities for storing mathematical expressions in databases then safely evaluating them later on.
The project includes unit tests, and detailed documentation can be found in the readme file.
Collage (GitHub: ozanturgut / collage, License: Apache 2.0) by Ozan Turgut is a framework for creating interactive collages. It can knit together remote APIs then present media in a two-dimensional space.
This example demonstrates some of the APIs that are supported as standard:
Backbone.js Screencasts is a
commercial set of Backbone.js tutorials from
30 Cubits that costs \$9 (until November 9th,
then \$18 thereafter) for 106 minutes of videos. The videos cover the
core Backbone.js functionality like views, routers, events, models,
your Backbone.js code.
XDate (GitHub: arshaw /
xdate, License: dual MIT and GPL)
by Adam Shaw is a wrapper around Date that provides
improved date parsing, formatting, and manipulation. XDate format
strings really help with
formatting dates, which I find myself doing a lot lately in Node or
single page applications.
Here's an example of XDate's formatting method:
new XDate(2011, 0, 1, 6, 0).toString('d/M/yy h(:mm)TT');
Another useful feature of this library is the set of XDate diffing
methods. They provide a friendly API
around date subtraction.
Most of XDate's methods return an XDate, so it's chainable
If you look at the source, you'll probably notice that I'm actually
using base 10000000, not base 10. I'm using decimal in these examples
because it makes things clearer but everything works pretty much
exactly the same way in any base. Using a larger base just makes
things more efficient because you get 7 digits in each array entry.
bigint by James Halliday is
an arbitrary precision arithmetic library for Node. Large integers can
be defined with strings, then manipulated with the library's methods:
var bigint = require('bigint');
var b = bigint('782910138827292261791972728324982')
Note that there's also a destroy method:
Destroy a bigint. This module is using node-ffi so I can't hook onto
the GC easily. You only need to call this if you're creating bigints
in a loop.
Other methods include rand, pow, and more.
This library can be installed with npm install bigint.
I actually have some experience in working with arbitrary precision
arithmetic from back in my university days -- I wrote a distributed
fractal generator with various numerical libraries. In Ada... This
sounds like a lot more fun!
I like writing CLI stuff, so I thought Mingy by Mike Cantelon
sounded pretty cool. He describes it as a "cheap and cheerful command
parser/server for node.js", perfect for creating command-line tools,
text adventure games, and even MUDs.
It can run as a server (hence the MUD reference), copes with multiple
users, includes validation support, and even has Expresso tests.
kyoto-client (GitHub: wezm /
kyoto-client, BSD License) by
Wesley Moore is a Kyoto Tycoon client
library. Kyoto Tycoon is a lightweight database server, from FAL Labs,
who also created the older Tokyo Cabinet key value database.
The kyoto-client module has some good documentation on the site and
seems straightforward to use. It can be installed with npm install
Blagovest's NPM Search
Blagovest's NPM Search by Blagovest
Dachev is a convenient (and fast) way to browse npm. In fact, it's
exactly the kind of thing I need to find things to write about for
DailyJS. Thanks Blagovest!