Adding optional dependency support to Molded
Channel: Will Anderson
Date: 2014-07-20

Molded is a library for writing dependency injected websites in Node. https://github.com/itsananderson/molded

When Molded resolves dependencies, it throws an exception if any requested dependencies are missing. In this video, I refactor it so that dependencies can be marked as optional. When Molded encounters optional dependencies that are missing, it will set the value of the dependency to "undefined" instead of throwing an exception.

I use mocha and supertest to validate my code while I work.

https://www.npmjs.org/package/mocha
https://www.npmjs.org/package/supertest