
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
require-one-of
Advanced tools
Conditional require with fallback support. Minimal size (>700B), no dependencies.
$ npm install require-one-of --save
const requireOneOf = require('require-one-of')
// throw an error if `puppeteer` not found
requireOneOf(['puppeteer'])
// throw an error if `puppeteer` or `puppeteer-core` not found
requireOneOf(['puppeteer', 'puppeteer-core'])
// pass fn as second argument for setup custom error
requireOneOf(['puppeteer', 'puppeteer-core'], modules => {
return new TypeError(
`Uh, oh. ${modules
.map(m => `'${m}'`)
.join(',')} not found on dependencies`
)
})
Required
Type: array
List of modules to be required. The first found will be resolved.
Type: function
It exposes the function to call to create the error to be returned in case none of the modules are found.
require-one-of © Kiko Beats, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.
kikobeats.com · GitHub Kiko Beats · Twitter @Kikobeats
1.0.8 (2019-04-06)
<a name="1.0.7"></a>
FAQs
Conditional require with fallback support
The npm package require-one-of receives a total of 891 weekly downloads. As such, require-one-of popularity was classified as not popular.
We found that require-one-of demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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 researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.