Created
March 24, 2012 04:12
-
-
Save musubu/2178166 to your computer and use it in GitHub Desktop.
simplest use of node module.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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