Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
grunt-listfiles-json
Advanced tools
Create a list of files and perform an action on each file in the list then write the results to a json file.
Create a list of files and perform an action on each file in the list then write the results to a file.
This plugin requires Grunt ~0.4.0
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-listfiles-json --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-listfiles-json');
This plugin was designed to work with Grunt 0.4.x.
Run this task with the grunt jsonlistfiles
command.
Task targets, files and options may be specified according to the grunt Configuring tasks guide.
grunt.initConfig({
jsonlistfiles: {
test1: {
variables: {
'$theme': 'test/fixtures/inner/*.css',
'$lang': 'test/fixtures/inner/*.js'
},
dest: {
'tmp/output.json': {
editor: {
css: {
'{%= $theme.filename %}': [
'{%= #$theme.path %}',
'test/fixtures/*.css',
'exclude2.scss'
]
},
js: {
'{%= $lang.filename %}': [
'{%= #$lang.path %}',
'test/fixtures/*.js'
]
}
}
}
}
}
}
});
grunt.loadNpmTasks('grunt-listfiles-json');
grunt.registerTask('default', ['jsonlistfiles']);
result of that is:
{
"editor": {
"css": {
"theme1": [
"test/fixtures/inner/theme1.css",
"test/fixtures/file1.css",
"exclude2.scss",
"test/fixtures/file3.css"
],
"theme2": [
"test/fixtures/inner/theme2.css",
"test/fixtures/file1.css",
"exclude2.scss",
"test/fixtures/file3.css"
]
},
"js": {
"ar": [
"test/fixtures/inner/ar.js",
"test/fixtures/file4.js",
"test/fixtures/file5.js",
"test/fixtures/file6.js",
"test/fixtures/file7.min.js",
"test/fixtures/file8.Min.js",
"test/fixtures/file_function_test.js"
],
"he": [
"test/fixtures/inner/he.js",
"test/fixtures/file4.js",
"test/fixtures/file5.js",
"test/fixtures/file6.js",
"test/fixtures/file7.min.js",
"test/fixtures/file8.Min.js",
"test/fixtures/file_function_test.js"
]
}
}
}
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
Create a list of files and perform an action on each file in the list then write the results to a json file.
The npm package grunt-listfiles-json receives a total of 11 weekly downloads. As such, grunt-listfiles-json popularity was classified as not popular.
We found that grunt-listfiles-json 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.