mkdir hello-wire
cd hello-wire
npm install wire
- Create main.js and spec.js as per the files in this gist.
node main.js
Created
August 8, 2012 21:05
-
-
Save briancavalier/3298791 to your computer and use it in GitHub Desktop.
Hello wired for wire.js in node
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
// Load wire | |
var wire = require('wire'); | |
// Use wire programmatically to wire the spec to produce | |
// a fully wired context. | |
wire(require('./spec')).then(function(context) { | |
console.log(context.message); | |
}, console.error); |
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
// A wire spec is just an object literal. Not much interesting | |
// in this one, but enough to do hello world! | |
module.exports = { | |
message: "I haz been wired" | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment