Socket
Socket
Sign inDemoInstall

givemetheservice

Package Overview
Dependencies
19
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    givemetheservice

ES6 dependency injection container.


Version published
Weekly downloads
3
Maintainers
1
Install size
1.62 MB
Created
Weekly downloads
 

Readme

Source

Give Me The Service

Give me the service is a ES6 dependency injection container for OOP.

NPM Build Status Coverage Status NPM Download Dependencies Status

npm install givemetheservice --save

Features

Services

Develop your own service in a separate file. Your don't need to instanciate it. GiveMeTheService DI do that job. If you use another service just inject it in your constructor.

What is the main avantage to use DI ?

You could easily override any service. Unit testing will be easy.

## Dependency injection

Just declare the service name in your constructor. Injected services are created as singleton.

class UserService {
    constructor(config)

GiveMeTheService will create your service with its dependencies.

Lifecycle

  1. inject
  2. create()
  3. mount()
  4. unmount()

Test

To run our tests, clone the Qwebs repo and install the dependencies.

$ git clone https://github.com/BenoitClaveau/givemetheservice --depth 1
$ cd givemetheservice
$ npm install
$ cd tests
$ node.exe "../node_modules/mocha/bin/mocha" .

Keywords

FAQs

Last updated on 27 Feb 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc