Skip to content

Instantly share code, notes, and snippets.

@mpj
Created September 4, 2017 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpj/eaf67c2f712cc4951be62db2ff573091 to your computer and use it in GitHub Desktop.
Save mpj/eaf67c2f712cc4951be62db2ff573091 to your computer and use it in GitHub Desktop.
no di example
let getUserName = require('./not-di-lib.js')
getUserName(1).then(name => console.log('the name of user 1 is', name))
let database = require('somedatabase')
function getUserName(id) {
return database.table('users').load(id)
.then(user => user.name)
}
module.exports = getUserName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment