Not sure what kind of backlash I'll get for doing things slightly different than the "Node" way, but I wrote what I believe is the easiest and lightest solution I've seen for dependency injection for Node.It's call Injector (https://github.com/scottcorgan/Injector)The idea is that you add a comment at the top of the file "// inject", then these files are automatically loaded and ready for injection. I've found it MUCH easier to inject mocks for tests. Also, when using this module, directory structure is only for visual organization for the coder. No need to worry about where the file is located, especially if you move the file to a different directory. Normally I'd just use another module, but I didn't find anything that was just easy. A lot of how the injection works is based off of the AngularJS source code.Anyways, would love some feedback. Always looking to improve the coding experience for developers.
Hi Scott,I'm also a big fan of Angulars dependency injection and looked exactly for a solution like yours. Thank you very much for sharing this.
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You would include them in the arguments like any other module. Just published an update for that feature.
On Friday, April 26, 2013 at 3:02 PM, Eldar wrote:
You might find easy-app also interesting.
--
I came across Architect https://npmjs.org/package/architect
What do you guys think about that? Have someone used it?
Regards
Who uses Injector currently? In Production?
Thanks for answering.
Kind regards
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/cRrQEjL7xBE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.