Skip to content

Instantly share code, notes, and snippets.

@bobagold
Created June 9, 2016 11:44
Show Gist options
  • Save bobagold/3367cd1ee40ce98c64310153d3bca395 to your computer and use it in GitHub Desktop.
Save bobagold/3367cd1ee40ce98c64310153d3bca395 to your computer and use it in GitHub Desktop.
cat > alice.js <<EOT
var public = require('./public');
public.message = 'Hi Bob';
EOT
cat > public.js <<EOT
module.exports = {};
EOT
cat > bob.js <<EOT
var public = require('./public');
console.log(public.message);
EOT
cat > demo.js <<EOT
require('./alice');
require('./bob');
EOT
node demo.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment