1.0.9 • Published 2 years ago
simplyrequire v1.0.9
simplyrequire
Require everything you could possibly need with a simple, readable one-liner, no strings attached.
BUGS (IMPORTANT)
- This uses "sloppy" mode. Simplyrequire CANNOT be used with strict-mode applications (due to using
this
to find the caller's instance) and strict mode will never be planned to be compatible. - Works on Windows, Node.JS 12+ ONLY! I have no idea why it doesn't work anywhere else, but it does on Windows!
if you can fix any of these bugs, open an issue at our github
Why should you use it over others like requireall
, which lets you require any file in a glob pattern in any folder?
Simple, fast local module name parsing. | keep your module instances as safe as possible, as quickly as possible.
Easy instance management. | just initialize with your packages.
Keep it true to the original require | execute the same functions as require, without any additions.
and best of all, you can still easily access module instances with
this.name
or evenname
without having to define a single variable!
USE IT!!!
require("simplyrequire")("package1", "package2");
See how simple that is? And you can still access every module as usual.
CHANGELOGS!!!
- Removed the need for using instance keywords, now in the
module.exports
function, we set the instance asthis
. - Fixed stupidity ig