
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
ES6-optimized dependency injection
const Poppins = require('poppins')
const inject = Poppins()
Here, our factory is named kite and requires paper and string as dependencies
inject('kite', ({paper, string}) => {
if (paper && string) {
return 'a kite!'
} else {
return 'no kite :('
}
})
inject('paper', () => true)
inject('string', () => true)
let {kite} = inject()
expect(kite).toEqual('a kite!')
let {kite} = inject({paper: false})
expect(kite).toEqual('no kite :(')
Each time you retrieve modules with let {foo, bar} = inject(), your factory functions are invoked to build the dependency tree. Caching is in place so each factory will be called at most once, even if multiple things depend on that module. However, a new cache is created for each time you call inject(). This allows you to have multiple instances of your app or library running in the same environment, while keeping their state isolated.
This also has benefits for test isolation, as you're guaranteed to get a brand-new object graph in each test if you access your modules using inject().
Poppins uses ES6 proxies. It comes with a polyfill so you don't need a native Proxy implementation to use it, but you'll get better error messages (for example, if you try to inject a module that doesn't exist) if your environment does have native Proxies.
FAQs
ES6-optimized dependency injection
The npm package poppins receives a total of 172 weekly downloads. As such, poppins popularity was classified as not popular.
We found that poppins demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.