Skip to content

Instantly share code, notes, and snippets.

@dreadjr
Forked from briancavalier/1-instructions.md
Last active August 29, 2015 14:08
Show Gist options
  • Save dreadjr/c0effb1649b309d53fda to your computer and use it in GitHub Desktop.
Save dreadjr/c0effb1649b309d53fda to your computer and use it in GitHub Desktop.

Hello wire in node.js

  1. mkdir hello-wire
  2. cd hello-wire
  3. npm install wire
  4. Create main.js and spec.js as per the files in this gist.
  5. node main.js
// 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);
// 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