UNPKG

json.excel

Version:
53 lines (38 loc) 1.34 kB
json.excel ========== ##### json to excel,or excel to json json file to excel file,or excel file to json file ## Getting Started ### whith grunt This plugin requires Grunt ~0.4.1 If you haven't used <a href="http://gruntjs.com/">Grunt</a> before, be sure to check out the <a href="http://gruntjs.com/getting-started">Getting Started</a> guide, as it explains how to create a <a href="http://gruntjs.com/sample-gruntfile">Gruntfile</a> 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 json.excel Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: go:{ options:{ json:json_file, excel:excel_file, to:'json', formating:true }, dist:{} } grunt.loadNpmTasks('json.excel'); grunt.registerTask('default',['go']); ### excel file format first row is keys,from second rows are datas,like this: |--a--|--b--|--c--| |--1--|--2--|--3--| |--3--|--2--|--1--| build this fromat json file,like this: { "data":[{ "a":"1", "b":"2", "c":"3" }{ "a":"3", "b":"2", "c":"1" }] }