Skip to content

fschwiet/JsfIoc

Repository files navigation

JsfIoc
by Frank Schwieterman


JsfIoc is a simple and light-weight inversion of container for javascript.  The goal is to provide an easy way to wire up dependencies while keeping the code size small.

Features:

- services may register dependencies on services
- services may have configuration parameters
- services may be singletons
- services may be generated by a factory method, or they can be a specific instance
- services can send and receive named events
- services can be loaded with test stubs for testing (see FakeJsfIoc)
- services can have tracing enabled
- a dependency graph can be printed (like https://github.com/fschwiet/JsfIoc/raw/master/lib/graphviz/test.jpg)

There are some sources of documentation:

- docs in progress:  http://fschwiet.github.com/JsfIoc/
- the tests:  https://github.com/fschwiet/JsfIoc/blob/master/src/JsfIoc.tests.js


JsfIoc will also produce a dependency graph prinatable with Graphviz (http://graphviz.org/).
To print a dependency graph, see how JsfIoc.GraphVizFormatting is used in the current test runner.
This produces output that GraphViz can process.  Use Graphviz from command line parameters like:

'C:\Program Files (x86)\Graphviz2.26.3\bin\dot.exe' -Tjpg .\input.dot -o output.jpg
'C:\Program Files (x86)\Graphviz2.26.3\bin\dot.exe' -Tjpg .\input.dot -o output.jpg
'C:\Program Files (x86)\Graphviz2.26.3\bin\dot.exe' -Tpdf .\input.dot -o output.pdf

About

An inversion of control container for Javascript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published