
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
grunt-contrib-requiregrep
Advanced tools
Grunt task that creates AMD modules by searching for dependencies on source files
Searchs for dependencies required on your source code (eg. template files) and generates an AMD module from it.
Example:
<!-- a/path/to/page.html -->
<!-- require("jquery, widgets, twitter") -->
<!-- another/path/to/anotherpage.html -->
<!-- require("jquery, widgets, fx") -->
Running grunt requiredep
can generate:
// all.js
define(['jquery', 'widgets', 'twitter', 'fx'], function()){
console.log('all modules loaded');
});
Now you can include this new module in your requirejs main config file. This allows you to use a AMD bundler like r.js (check grunt-contrib-requirejs).
Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-contrib-requiregrep
Then add this line to your project's gruntfile:
grunt.loadNpmTasks('grunt-contrib-requiregrep');
Supports the following options:
all.js
)/require\(\s*[\'\"]([^\'\"]*)[\'\"]/gi
console.log('all modules loaded!');
). default: ''/*jslint node:true*/
module.exports = function (grunt) {
'use strict';
grunt.loadNpmTasks('grunt-contrib-requiregrep'); // load the task
grunt.initConfig({
watch: {
files: '<config:requiregrep.files>',
tasks: 'requiregrep'
},
requiregrep: { // configure the task
all: {
files: [ // some example files
'home.html',
'view/**/*.html'
],
dest: 'scripts/all.js',
options: {
onLoad: 'if (window.console){window.console('all modules loaded');}', // run after all dependencies are loaded
}
}
}
});
grunt.registerTask('default', 'watch');
};
FAQs
Grunt task that creates AMD modules by searching for dependencies on source files
The npm package grunt-contrib-requiregrep receives a total of 0 weekly downloads. As such, grunt-contrib-requiregrep popularity was classified as not popular.
We found that grunt-contrib-requiregrep 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
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.