![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
grunt-dump-dir
Advanced tools
Grunt task to dump a dictionary (all files and their content) into a JSON object
Grunt task to dump a dictionary (all files and their content) into a JSON object
grunt-dump-dir lets you select a directory and generates a JSON representation with keys being filepaths and values - their content encoded in base64.
The main use case for this plugin is virtual filesystem generation for browserify projects.
This plugin requires Grunt ~0.4.2
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-dump-dir --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-dump-dir');
In your project's Gruntfile, add a section named dump_dir
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
dump_dir: {
options: {
// options
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
});
Type: String
Default value: ``
A string value which is trimmed from physical path when JSON keys are created.
Type: string
Default value: module.exports =
String which prefixes generated JSON. Should be used to specify the assignment. The default module.exports =
is not very functional unless the file is used as input to browserify.
Usually you should set it to something like var myVariable =
If you don't specify options.rootPath
:
grunt.initConfig({
dump_dir: {
options: {
},
files: {
'dest.js': [ 'directory/**/*' ]
},
},
});
the output will contain full-path keys:
{
"directory/filename.txt": "base64-encoded-content",
"directory/filename2.jpg": "base64-encoded-content"
}
If rootPath
is provided:
grunt.initConfig({
dump_dir: {
options: {
'rootPath': 'directory/'
},
files: {
'dest.js': [ 'directory/**/*' ]
},
},
});
we'll get the following JSON:
{
"filename.txt": "base64-encoded-content",
"filename2.jpg": "base64-encoded-content"
}
FAQs
Grunt task to dump a dictionary (all files and their content) into a JSON object
We found that grunt-dump-dir 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
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.