Ideas and Facts from Scotland.js in Edinburgh | ArangoDB ’13
Test Driven Development
I have been one of the lucky attendants of scotland.js in Edinburgh recently.
It was a really nice & informative conference, thanks to all people that made it possible.
I did really like to see that TDD is reaching the front-end developers finally.
A lot of useful tools for this have been presented by James Shore, Bernard Kobos and Sebastian Golasch.
In ArangoDB, TDD is in action all day and I am looking forward to improving our front-end testing even further using these awesome tools.
Front-end Development meets NoSQL
Furthermore several talks focussing on front-end development have been given, e.g. by Gregor Martynus presenting Hoodie.js.
These front-end talks and my discussions with other attendees gave me the impression that front-end developers spend a lot of time deciding which database they should use. (more…)
Foxx Screencast Part 2: Dive Deeper | ArangoDB ’13
It has taken some time, but now part 2 of the Foxx Screencast is available. I talk about some more advanced topics of Foxx and also plans for the future.
CoffeeScript in ArangoDB: Feature Preview | ArangoDB 2013
In my blog post about npm packages, I tried to use underscore for ArangoDB. I found that the easiest way to archive this, is using the nodes package manager NPM. Node packages and modules follow the Common.JS specification, so they can be used by ArangoDB.
Why not try to use the package coffee-script as well? Install it using
npm install coffee-script
and that’s it. Unfortunately, CoffeeScript use a module “path”, which is not a CommonJS module. I assume that most of the functionality is part or will be part of the module “fs”. The “path.js” from node.js is simple JavaScript code with some references like
'path.exists is now called `fs.exists`'
Being brave, I simply copied the file into my module path and tried again. The next obstacle is node’s global variable “process”. Luckily, this is only used to check for Windows in the module “path”. Also ignoring the module “vm” used to execute JavaScript code, this allows one to actually load CoffeScript into ArangoDB.
arangosh> process = {};
{ }
arangosh> var cs = require("coffee-script");
arangosh> cs.compile("a = 1\nopposite = true\na = -a if opposite", {});
(function() {
var a, opposite;
a = 1;
opposite = true;
if (opposite) {
a = -a;
}
}).call(this);
So, I can now use CoffeeScript definition within ArangoDB. Some of the loaders must be adjusted to check for both “.js” and “.coffee” files. Afterwards it should be possible, to define an action in CoffeeScript as well as JavaScript.
Using NPM Packages for ArangoDB: Enhance Functionality | 2013
ArangoDB follows the Common.JS specification for modules. However, it would be very convenient, if there was an easy way to install a package like “underscore.js”. These package are, for instance, available using NPM. There is a draft for packages on Common.JS which seems to be compatible with NPM.
NPM has a neat way of dealing with version conflicts. Basically, it allows multiple versions to exists simultaneously. For example, assume you have 4 packages A, B, C, D. A requires B and C and D, B requires C. Then directory layout might be as follows.
node_modules
|
+- A
| |
| +- node_modules
| |
| +- B
| | |
| | +- node_modules
| | |
| | +- C (1.0.0)
| |
| +- C (2.0.0)
|
+- D
Package B will see package C in version 1.0.0, while package A sees package C in version 2.0.0.
<!--more-->
This behaviour is easy to implement in ArangoDB. In addition to “Module” there is now a “Package”. Each package has it own module cache. When a package requires a module, the package hierarchy is traversed from the current package to the root (or global) package, until the module is found.
In order to use underscore, switch into the package directory and use NPM to install it
unix> cd /tmp/packages
unix> npm install underscore
npm http GET https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/underscore
underscore@1.4.4 node_modules/underscore
Now start arangosh with the new “–javascript.package-path” option and enjoy underscore.
unix> arangosh --javascript.package-path /tmp/packages
arangosh> var _ = require("underscore");
arangosh> _.max([1,2,3])
3
Useful ArangoSH Tips and Tricks | ArangoDB 2012
arangosh, The ArangoDB shell, provides some options that may simplify an ArangoDB user’s life. Some of these options have been added in version 1.1.2, and some options have been around for a while but are probably still less known. It’s time to showcase them.
(more…)
ArangoDB: Using JavaScript in the Database | ArangoDB 2012
Jan was invited as a speaker to “Js.Everywhere” in Paris. He talked about using Javascript in a database, well, ArangoDB, to be precise, giving lots of examples on “actions” and related concepts in ArangoDB.
- « Previous
- 1
- 2
Get the latest tutorials,
blog posts and news:
Thanks for subscribing! Please check your email for further instructions.