Last active
April 5, 2018 19:37
-
-
Save cmstead/a98472fdebd6e4fa5e691e1ebf7d7e9b to your computer and use it in GitHub Desktop.
Dject main application example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// The only explicit filesystem or module reference in our whole application!!! | |
const container = require('./example-container'); | |
const fileReader = container.build('fileReader'); | |
// installed and system modules are loaded implicitly, no extra declaration needed | |
const path = container.build('path'); | |
const contents = fileReader.readAFile(path.join(__dirname, 'staticFiles', 'myFile.txt')); | |
console.log(contents); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment