Skip to content

Instantly share code, notes, and snippets.

@musubu
Created March 24, 2012 04:12
Show Gist options
  • Save musubu/2178166 to your computer and use it in GitHub Desktop.
Save musubu/2178166 to your computer and use it in GitHub Desktop.
simplest use of node module.
// entry.js
function Entry (title) {
this.title = title;
}
Entry.prototype = {
title: null;
}
module.exports = Entry;
// test.js
var Entry = require('./entry')
, entry = new Entry('first entry');
console.log(entry.title);
// shell
node test.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment