
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
Advanced tools
Load the first package found from the given array.
Method | Installation |
---|---|
npm | npm install require-one --save |
component | component install robloach/require-one |
Composer | composer require require-one |
Bower | bower install require-one |
This works across CommonJS/node, AMD and with global variables for the browser.
This is an example of loading either jQuery, Zepto, or Cheerio with a CommonJS module loader, like Node.js.
var $ = requireOne('jquery', 'zepto', 'cheerio');
// => jQuery, Zepto or Cheerio, depending on which one is available.
This is an example of loading either jQuery, Zepto, or Cheerio with an AMD module loader, like Require.js.
require(['require-one'], function(requireOne) {
// Retrieve the first package that is available.
var $ = requireOne('jquery', 'zepto', 'cheerio');
// => jQuery, Zepto or Cheerio, depending on which one is available.
// ...
});
This is an example of loading either jQuery, Zepto, or Cheerio without a module loader, i.e. with the browser's global variables.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="path/to/require-one.js"></script>
<script>
var $ = requireOne('jquery', 'jQuery', 'zepto', 'Zepto', 'cheerio');
// => jQuery, Zepto or Cheerio, depending on which one is available.
</script>
</head>
<body>
<h1>My Sample Project</h1>
</body>
</html>
[1.0.2] - 2015-03-29
require-one.js
FAQs
Require the first found package from an array.
The npm package require-one receives a total of 2,579 weekly downloads. As such, require-one popularity was classified as popular.
We found that require-one 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.
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.