New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

simplistic

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simplistic

A simple Javascript-based dependency injection module

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

simplistic

A simple Javascript-based dependency injection module

Motivation

Dependency injection leads to better component encapsulation, increases testability and promotes configurability. Components can expose clear interfaces, there's no need to override the NodeJS module resolution logic in unit tests and it's actually easy to write real unit tests.

Features

  • Supports pure components as components are not aware of the container
  • Easily isolates system dependencies
  • Caches dependencies
  • Allows for dependency expansion using multiple dependency files (think universal apps)

Example usage


import containerFactory from 'simplistic';

const container = containerFactory();

var dependencies = {
  request: () => require('request'),
  
  apiClient: () => {
    const component = require('/some/api/client/implementation.js');
    return component(
      container.wire('request')
    );
  }

};

export default container.build(dependencies);

Keywords

FAQs

Package last updated on 19 Mar 2023

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