Skip to content

Instantly share code, notes, and snippets.

Created May 10, 2014
What would you like to do?
An example of Node core module bindings for DI.
import {module as nodeBindings} from './node_bindings';
import {Injector} from 'di';
import {Foo} from './foo';
var injector = new Injector(nodeBindings);
var foo = injector.get(Foo);
import {Inject} from 'di';
module fs from 'fs';
@Inject(fs.readFile, fs.writeFile)
export class Foo {
constructor(readFile, writeFile) {}
var fs = require('fs');
export var module = [
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment