
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
require-package
Advanced tools
require-package is a simple library to build a config object that can be used with the requirejs AMD loader. It will generate the appropriate path, shim and module information for your specified environment, enabling the packaging information to be specified in only one place.
For example, in your package json:
"vendor": {
"backbone": {
"source": "node_modules/backbone.js",
"shim": {"exports": "Backbone", "deps": ["underscore","jquery"]}
},
"underscore": {
"source": "node_modules/underscore/underscore-min.js",
"shim": {"exports": "_"}
},
"jquery": {
"source": "vendor/js/jquery-1.8.1.min.js"
}
}
Then, you can build use require-package in various places to vendor and build a config file for requirejs.
// in jakefile, to vendor the javascript files into your server
var requirePackage = require('require-package');
var toVendor = requirePackage.vendor('www/js/vendor');
for (var source in toVendor) {
file(toVendor[source], [source], function() {
jake.cpR(source,toVendor[source]);
});
}
Or, in your templates, to init requirejs:
require.config(<% require('require-package').config({baseUrl: '/js'}) %>);
require-config
exports several functions to help in your build setup.
vendor
will return on object with the path to the source file to be
vendored as the key, and the destination path as the value:
{ 'node_modules/backbone/backbone.js': 'www/js/vendor/backbone.js' }
Extends the baseConfig object with the shim and path config values.
FAQs
Generate requirejs configuration from package.json values
The npm package require-package receives a total of 0 weekly downloads. As such, require-package popularity was classified as not popular.
We found that require-package 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.