Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
grunt-task-file
Advanced tools
Readme
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
The npm package grunt-task-file receives a total of 1 weekly downloads. As such, grunt-task-file popularity was classified as not popular.
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.