<commit_before># grunt-file-to-json
Take the content of all files and put them on a json file with filename as key.

## Why I wrote this plugin?
I need to embed the content of several files to one file for different purpose. The idea is to have some kind of bundle.

Today, this plugin exports directly in a JSON file, but with some improvement, this plugin should be able to export in different format and use some preprocessor for some file extension (minify JS/CSS for example).

## Getting Started
This plugin requires Grunt.

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out this [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install github:MasGaNo/grunt-file-to-json --save-dev
```

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

```js
grunt.loadNpmTasks('grunt-file-to-json');
```

## The task

### Overview
In your project's Gruntfile, add a section named `file_to_json` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
  file_to_json: {
    options: {
        // removeExt: boolean | default: false
        // prettify: boolean | default: false
        // plainObject: boolean | default: true
        // separator: string | default: /
        // parseJSON: boolean | default: false
    },
    your_target: {
      /** contents like this:
        files: [
            {
                cwd: 
                src: ['*'],
                dest: 'saveThe/result.json'
            }
        ]
      */
    },
  },
})
```

### Options

#### options.removeExt
Type: `Boolean`
Default value: `false`

Remove the extension from the name of the key.

#### options.prettify
Type: `Boolean`<commit_msg>Fix options.<commit_after># grunt-file-to-json
Take the content of all files and put them on a json file with filename as key.

## Why I wrote this plugin?
I need to embed the content of several files to one file for different purpose. The idea is to have some kind of bundle.

Today, this plugin exports directly in a JSON file, but with some improvement, this plugin should be able to export in different format and use some preprocessor for some file extension (minify JS/CSS for example).

## Getting Started
This plugin requires Grunt.

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out this [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install github:MasGaNo/grunt-file-to-json --save-dev
```

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

```js
grunt.loadNpmTasks('grunt-file-to-json');
```

## The task

### Overview
In your project's Gruntfile, add a section named `file_to_json` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
  file_to_json: {
    your_target: {
      options: {
          // removeExt: boolean | default: false
          // prettify: boolean | default: false
          // plainObject: boolean | default: true
          // separator: string | default: /
          // parseJSON: boolean | default: false
      },
      /** contents like this:
      files: [
          {
              cwd: 
              src: ['*'],
              dest: 'saveThe/result.json'
          }
      ]
      */
    },
  },
})
```

### Options

#### options.removeExt
Type: `Boolean`
Default value: `false`

Remove the extension from the name of the key.

#### options.prettify
Type: `Boolean`
{'fraction_non_alphanumeric': 0.10314819554645507, 'fraction_numerical': 0.0, 'mean_word_length': 2.943491422805247, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '433886', 'n_tokens_mistral': 1135, 'n_tokens_neox': 1093, 'n_words': 458}