
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
ember-require-module
Advanced tools
Easily require a module which will silently fail if it is not found.
Dynamically require modules
ember install ember-require-module
If it is a bug please open an issue on GitHub.
import requireModule from 'ember-require-module';
const moment = requireModule('moment');
// requireModule will return undefined if moment is not found
assert('MomentJS is required!', moment);
// Dynamically require modules when needed
function runTask(taskName, ...params) {
let task = requireModule(`my-addon/tasks/${taskName}`);
assert(`The task ${taskName} does not exist.`, task);
return task.run(...params);
}
// import a named export from a module
const THING = requireModule('path-to-module', 'THING');
See the Changelog
See the Contributing guide for details.
This project is licensed under the MIT License.
FAQs
Easily require a module which will silently fail if it is not found.
We found that ember-require-module demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.