index.js
function createFile() {
        let fileContent = '';

        /*
         * Customize data by type
         */
        switch (options.type) {
        case 'js':
            fileContent += `'use strict';` + '\n';
            for (let collectionKey in _variableCollection) {
                fileContent += `const ${collectionKey} = '${_variableCollection[collectionKey]}';` + '\n';
            }

            if (_.endsWith(options.file, 'js') === false) options.file += '.js';

            break;
        default:
            /* json */
            fileContent = JSON.stringify(_variableCollection);

            if (_.endsWith(options.file, 'json') === false) options.file += '.json';
        }

        /*
         * Write file
         */
        return fs.writeFileSync(options.file, fileContent, 'utf8');
    }
function createFile() {
        let fileContent = '';

        /*
         * Customize data by type
         */
        switch (options.type) {
        case 'js':
            fileContent += `'use strict';` + '\n';
            for (let collectionKey in _variableCollection) {
                fileContent += `const ${collectionKey} = '${_variableCollection[collectionKey]}';` + '\n';
            }

            if (_.endsWith(options.file, 'js') === false) options.file += '.js';

            break;
        default:
            /* json */
            fileContent = JSON.stringify(_variableCollection);

            if (_.endsWith(options.file, 'json') === false) options.file += '.json';
        }

        /*
         * Write file
         */
        return fs.writeFileSync(options.file, fileContent, 'utf8');
    }
function createFile ( ) { let fileContent = '' ; /*
         * Customize data by type
         */ switch ( options . type ) { case 'js' : fileContent += ` ` + '\n' ; for ( let collectionKey in _variableCollection ) { fileContent += ` ${ collectionKey } ${ _variableCollection [ collectionKey ] } ` + '\n' ; } if ( _ . endsWith ( options . file , 'js' ) === false ) options . file += '.js' ; break ; default : /* json */ fileContent = JSON . stringify ( _variableCollection ) ; if ( _ . endsWith ( options . file , 'json' ) === false ) options . file += '.json' ; } /*
         * Write file
         */ return fs . writeFileSync ( options . file , fileContent , 'utf8' ) ; }
Create file.
Create file .