GithubHelp home page GithubHelp logo

divmgl / nwire Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 1.0 237 KB

Simplified dependency injection in TypeScript

TypeScript 98.53% JavaScript 1.47%
dependency-injection inversion-of-control typescript

nwire's People

Contributors

divmgl avatar gitter-badger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

gitter-badger

nwire's Issues

Lazy loading

Imported dependencies should only be loaded when attempting to access them. This should cut down on memory costs with complex applications.

Dependencies should not be singleton unless specified explicitly

Currently, packages live as a single instance. When a consumer requires an imported package, it is looked for in a container, meaning that all packages operate in a singleton scope.

This may be undesirable but I need input from users of this package to know whether imports should not be singleton.

did not work

the thingie wouldn't install on Mac OS X 10.5.21

Remove dependency on base URL and require

Currently, configuration files require a base URL and strings pointing to modules on a hard disk in order to work.

module.exports = {
  url: __dirname, // Base URL
  packages: { // Packages to be injected
    'server': './server',
    'express': 'express'
  }
}

Would it make more sense to simply resolve modules from the working directory? Consider the following code.

module.exports = {
  packages: {
    'server': require('./server'),
    'express': require('express')
  }
}

Here we are specifically specifying what we want nwire.js to load, so the dependency on the base URL is gone. Any opinions on this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.