New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.12
  • npm
  • Socket score

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

Typescript Container (IOC)

An attempt to bring illuminate/container familiarity into typescript.

Build Status NPM Version Downloads Stats

This is a small attempt to bring/port Laravel's IoC container (illuminate/container) to typescript with the help of decorators.

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
  • overriding constructor parameters
  • 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.8
    • 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