Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@mintlab/cherrypack
Advanced tools
Do different things depending on NODE_ENV.
$ yarn add @mintlab/cherrypack
The package exports a function that is called with an object that uses the environments as property names.
const cherrypack = require('cherrypack');
module.exports = cherrypack({
development: 'foo', // export `foo` in production
production: 'bar', // export `bar` in production
});
If you need to require and execute complex and expensive code, you can encapsulate that with a method that will be used as a callback:
module.exports = cherrypack({
development() {
return new require('ExpensiveDevelopmentClass')(/* complex argument(s) */);
},
production() {
return new require('ExpensiveProductionClass')(/* complex argument(s) */);
},
});
If process.env.NODE_ENV
is not set, it defaults to development
;
Copyright Mintlab B.V.
Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence").
You may not use this work except in compliance with the Licence.
You may obtain a copy of the Licence at: https://joinup.ec.europa.eu/software/page/eupl
FAQs
Do different things depending on NODE_ENV.
The npm package @mintlab/cherrypack receives a total of 11 weekly downloads. As such, @mintlab/cherrypack popularity was classified as not popular.
We found that @mintlab/cherrypack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.