
Research
/Security News
Bitwarden CLI Compromised in Ongoing Checkmarx Supply Chain Campaign
Bitwarden CLI 2026.4.0 was compromised in the Checkmarx supply chain campaign after attackers abused a GitHub Action in Bitwarden’s CI/CD pipeline.
grunt-task-file
Advanced tools
Run a grunt task over a single file
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-task-file --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-task-file');
There are many tasks in grunt which run over your source files (jshint, less, ...) To run those tasks you need to provide the source files which will be affected by the tasks, and you have to do it inside grunt config. However, there are some scenarios where you would like to run the task only over a file and don't want to modify the existing grunt configuration. Grunt file comes to the rescue.
The only thing you need to do is run the file task, specifying the underlying task you want to run and the target file of the task.
Imagine you want to run jshint task over only one file. What you have to do is only run in console:
grunt file:jshint --file some-file.js
without changing anything in Grunt configuration. This won't affect other configuration targets for the underlying task.
It is possible to set specific configuration for the underlying task, when running it over a single file. To do so,
in the config, a file target must be specified.
grunt.initConfig({
jshint: {
options: {
curly: true,
eqeqeq: true,
eqnull: true,
browser: true,
globals: {
jQuery: true
},
},
all: { // Default task for all files
files: {
src: ['**/*.js']
}
},
file: { // Custom task for one file.
options: { // You can modify some options when running the task over a single file
curly: false
}
// It is not needed to specify files, as it will be done from the shell
}
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
FAQs
Run a grunt task over a single file
We found that grunt-task-file 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.

Research
/Security News
Bitwarden CLI 2026.4.0 was compromised in the Checkmarx supply chain campaign after attackers abused a GitHub Action in Bitwarden’s CI/CD pipeline.

Research
/Security News
Docker and Socket have uncovered malicious Checkmarx KICS images and suspicious code extension releases in a broader supply chain compromise.

Product
Stay on top of alert changes with filtered subscriptions, batched summaries, and notification routing built for triage.