Skip to content

Instantly share code, notes, and snippets.

@zacharyhill
Created August 31, 2017 22:55
Show Gist options
  • Save zacharyhill/4977db11e2acbd5d4c6d521995daf77c to your computer and use it in GitHub Desktop.
Save zacharyhill/4977db11e2acbd5d4c6d521995daf77c to your computer and use it in GitHub Desktop.
module.exports = {
foo: 'bar',
num: 22,
items: [
'item1', 'item2', 'item3'
],
};
@zacharyhill
Copy link
Author

zacharyhill commented Aug 31, 2017

Now in another file you could do...

var ourObj = require('./file_we_just_made.js');
console.log(ourObj.foo); // prints var
console.log(ourObj.items) // returns ['item1', 'item2', 'item3']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment