Skip to content

Instantly share code, notes, and snippets.

View ethanmuller's full-sized avatar

Ethan Muller ethanmuller

View GitHub Profile
@hagope
hagope / dirTree.js
Created June 26, 2012 17:37
Output the file system as a JSON using node.js
var fs = require('fs'),
path = require('path')
function dirTree(filename) {
var stats = fs.lstatSync(filename),
info = {
path: filename,
name: path.basename(filename)
};
@fwielstra
fwielstra / api.js
Created June 14, 2011 14:46
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');