Skip to content

Grunt plugin that generates a json file contains list of files in a given path.

License

Notifications You must be signed in to change notification settings

shukriadams/grunt-filenames-to-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-filenames-to-json

Grunt plugin that generates a json file contains list of files in a given path. Json is an array of file name strings.

Getting started

  • install in npm

    npm install grunt-filenames-to-json

  • add to Gruntfile

    grunt.loadNpmTasks('grunt-filenames-to-json');

Configure

grunt.initConfig({

    filenamesToJson : {
    	options : {
    		// true if full path should be included, default is false
    		fullPath : false,
    		// true if file extension should be included, default is false 
    		extensions : false
    	},
    	// any valid glob
        files : '**/js',

        // path to write json to
        destination : 'some/path/output.json'
    }

});

Test

  • Clone repo
  • Run "npm install"
  • Run "grunt test" to generate a JSON file of all js files in the repo you've cloned. The file output is "javascriptFileNames.json" in the repo root.

About

Grunt plugin that generates a json file contains list of files in a given path.

Resources

License

Stars

Watchers

Forks

Packages

No packages published