Skip to content

Instantly share code, notes, and snippets.

@malte-j
Created February 11, 2018 20:18
Show Gist options
  • Save malte-j/8e8ee78b209f87a1286b5bf003e4ae23 to your computer and use it in GitHub Desktop.
Save malte-j/8e8ee78b209f87a1286b5bf003e4ae23 to your computer and use it in GitHub Desktop.
Require Example
// JSON Objekt mit text Attribut
let data = {
text: "lorem ipsum"
}
// gibt den Text zurück
module.exports.getText = () => data.text;
// setzt den Text
module.exports.setText = newText => data.text = newText;
let library = require('./library-example');
// gibt den Text in der Konsole aus
console.log(library.getText())
let library = require('./library-example');
library.setText('Beispieltext');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment