Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
modjewel provides a require() function for use with CommonJS modules, designed for use in web browsers.
The modjewel-require.js
file provides require()
and define()
functions for use with CommonJS modules,
designed for use in web browsers. The define()
function is as
specified in Asynchronous Module Definition
(AMD).
Note that dynamic loading is not supported; see the note on define()
below.
see: http://wiki.commonjs.org/wiki/Modules/1.1
Runs tests from the commonjs project.
Use the test/run-tests.sh
file to run the tests. The tests will run
in both the browser and command-line via Rhino.
see http://wiki.commonjs.org/wiki/Unit_Testing/1.0
Note that one test failure is occurring with the assert tests. Looks like a bogus test to me.
see http://wiki.commonjs.org/wiki/System/1.0
This module is not really supported, but a system module is supplied with a
print
method which will work in the browser and Rhino.
This function allows you to "preload" a module. In fact, this is the only way to load modules - modules are never loaded dynamically.
The object passed to this function is described in Asynchronous Module Definition.
Using modjewel, you will have a free module available for you to require()
,
with the module id "modjewel"
. This module exports the following
properties and functions:
VERSION
Returns the current version of modjewel.
getLoadedModuleIds()
Returns an array of strings which are the module ids which have currently been loaded.
getPreloadedModuleIds()
Returns an array of strings which are the module ids which have currently
been preloaded with the require.define()
function.
getModule(moduleId)
Returns the module with the specified moduleId. Use null
to get the
primordial main
module.
getModuleIdsRequired(moduleId)
Returns the module ids that the specified module require()
'd.
warnOnRecursiveRequire([value])
Issue a warning if a module is being recursively required. That is, in the process of the module being loaded, if it requires a module that in turn ends up requiring itself, a console message is generated indicating this.
In general, you don't need to worry about this. You do need to worry
about this if you make use of the module.exports =
trick of changing
your module's exports value. In this case, your new exports
object
may not be set before another module needs it. Using this flag will
warn you of such cases. You may need to restructure your modules, or
change the order in which you set the exports
object and make
require()
calls.
Note that modjewel itself supports the module.exports =
trick to
reassign a module's export
value. This is useful if you'd like to
export a single function or class from your module, so that clients
of the module don't need to further derference the exports
object
to get at your goodies.
Convert CommonJS modules to AMD format. It can also generate a HTML
test driver to test the modules in a browser. It generates files named
(original base name).amd.js
from files named (original base name).js
.
The generated files have code prefixing and suffixing the original file
contents with a define()
invocation. The contents of the file
are otherwise unchanged, and the line numbers for the content will be the
same in both files.
Use the modjewel project at github for communication.
FAQs
modjewel provides a require() function for use with CommonJS modules, designed for use in web browsers.
We found that modjewel 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.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.