Skip to content

Instantly share code, notes, and snippets.

View temsa's full-sized avatar

Florian Traverse temsa

View GitHub Profile
@temsa
temsa / cat.js
Created February 14, 2011 10:14
Cat a file with node in one line
#!/usr/local/bin/node
require(‘fs’).readFile(process.argv[2], function(err,buf){ process.stdout.write(buf); });
@temsa
temsa / explicit_module_syntax_example.js
Created January 4, 2011 10:57
A possible module syntax
module.name("foobar")
.import("bar/foo").as("foo")
.import("baz")//.as("baz") is implied
.declare(function(require) {
var foo = require("foo"),
bazbar = require("baz").bar;
return {hello: foo.bar, world: bazbar};
});