
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
maishu-requirejs-plugins
Advanced tools
Small set of plugins for [RequireJS](http://requirejs.org). Some plugins may also work on other AMD loaders (never tested it).
Small set of plugins for RequireJS. Some plugins may also work on other AMD loaders (never tested it).
For more plugins check RequireJS Wiki.
You can use bower to install it easily:
bower install --save requirejs-plugins
propertyParser
)async!
plugin and propertyParser
).text!
plugin).text!
plugin and a markdown converter).check the examples
folder. All the info you probably need will be inside
comments or on the example code itself.
Put the plugins inside the baseUrl
folder (usually same folder as the main.js
file) or create an alias to the plugin location:
require.config({
paths : {
//create alias to plugins (not needed if plugins are on the baseUrl)
async: 'lib/require/async',
font: 'lib/require/font',
goog: 'lib/require/goog',
image: 'lib/require/image',
json: 'lib/require/json',
noext: 'lib/require/noext',
mdown: 'lib/require/mdown',
propertyParser : 'lib/require/propertyParser',
markdownConverter : 'lib/Markdown.Converter'
}
});
//use plugins as if they were at baseUrl
define([
'image!awsum.jpg',
'json!data/foo.json',
'noext!js/bar.php',
'mdown!data/lorem_ipsum.md',
'async!http://maps.google.com/maps/api/js?sensor=false',
'goog!visualization,1,packages:[corechart,geochart]',
'goog!search,1',
'font!google,families:[Tangerine,Cantarell]'
], function(awsum, foo, bar, loremIpsum){
//all dependencies are loaded (including gmaps and other google apis)
}
);
r.js
nowadays have the stubModules
setting which can be used to remove the whole
plugin code:
({
// will remove whole source code of "json" and "text" plugins during build
// JSON/text files that are bundled during build will still work fine but
// you won't be able to load JSON/text files dynamically after build
stubModules : ['json', 'text']
})
The Markdown plugin was created mainly to be used to compile the markdown files
into HTML during the build step, if you set pragmasOnSave.excludeMdown=true
it will remove the Markdown.Converter.js
and mdown.js
files from the build.
Example build settings:
({
baseUrl : './',
pragmasOnSave : {
excludeMdown : true
},
paths : {
mdown : 'lib/requirejs/mdown',
text : 'lib/requirejs/text',
markdownConverter : 'lib/Markdown.Converter'
},
modules : {
name : 'main'
}
})
If excludeMdown=true
you won't be able to load markdown files dynamically
after the build.
Check RequireJS documentation for a basic reference and use other plugins as reference. RequireJS official plugins are a good source for learning.
Also be sure to check RequireJS Wiki.
All the plugins are released under the MIT license.
FAQs
Small set of plugins for [RequireJS](http://requirejs.org). Some plugins may also work on other AMD loaders (never tested it).
We found that maishu-requirejs-plugins 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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.