Skip to content

Instantly share code, notes, and snippets.

@thatkookooguy
Created September 29, 2020 12:04
Show Gist options
  • Save thatkookooguy/a25351b3ed7d342271076e319eba48ee to your computer and use it in GitHub Desktop.
Save thatkookooguy/a25351b3ed7d342271076e319eba48ee to your computer and use it in GitHub Desktop.
example of require
const lib = require('./node-module');
const newPizza = new lib.Pizza();
// or
const { Pizza, Lazagna, constant } = require('./node-module');
const newPizza = new Pizza();
class Pizza {}
class Lazagna {}
module.exports = {
Pizza, // or whatever you want to assign it to
Lazagna, // again, set it to what you like
constant: 5 // an example of a static thing
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment