grunt-strip-json-comments

Strip comments from JSON. Lets you use comments in your JSON files!

npm install grunt-strip-json-comments
1 downloads in the last day
9 downloads in the last week
63 downloads in the last month

grunt-strip-json-comments Build Status

Strip comments from JSON. Lets you use comments in your JSON files!

Using the strip-json-comments module.

This is now possible:

{
    // rainbows
    "unicorn": /* ❤ */ "cake"
}

Getting Started

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, install this plugin with this command:

npm install --save-dev grunt-strip-json-comments

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-strip-json-comments');

Tip: the load-grunt-tasks module makes it easier to load multiple grunt tasks.

Example config

grunt.initConfig({
    stripJsonComments: {                            // Task
        dist: {                                        // Target
            files: {                                // Dictionary of files
                'dist/file.json': 'src/file.json'    // 'destination': 'source'
            }
        }
    }
});

grunt.loadNpmTasks('grunt-strip-json-comments');
grunt.registerTask('default', ['stripJsonComments']);

License

MIT © Sindre Sorhus

npm loves you