Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typescript-container

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typescript-container

Laravel (illuminate/container) inspired/based IoC container.

  • 0.0.14
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Typescript Container (IOC)

Laravel's famous illuminate/container ported to typescript

Build Status NPM Version Downloads Stats

This is a small attempt to bring Laravel's IoC container (illuminate/container) to typescript with the help of decorators.
NOTE: this module is not compatible with ES (Babel) alone, the reason for that, ES doesn't support parameter decorator.

Installation

npm i --save typescript-container

Known issues / Not working

  • Since stand-alone function doesn't support parameter decorators, Injecting dependencies on function doesn't work.
  • Primitive types as dependency
  • callback supports

Basic Usage

You can start by requiring the ioc container then do your thing.

src/index.ts:

index
src/Pokemon.ts:

pokemon
src/Character.ts:

character
src/Map.ts:

map
src/Monster.ts:

monster

injecting dependencies to any other method (other than constructor) also works.

Release History

  • 0.0.14
    • Override constructor parameter support
    • added tagging feature
    • cleanup package (only include /dist folder, package.json and LICENSE)
    • removed babel from project
  • 0.0.7
    • arbitrary binding support
    • arbitrary value store support
    • flush() added
    • declaration file (d.ts) added
  • 0.0.3
    • added factory() and singleton()
    • basic contextual binding added
    • basic functionality

Meta

Jacob Baring – @yakovmeisterso@tfwno.gf

Distributed under the MIT license. See LICENSE for more information.

https://github.com/yakovmeister/

Contributing

  1. Fork it (https://github.com/yakovmeister/typescript-container/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Keywords

FAQs

Package last updated on 15 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc