1.0.2 • Published 5 years ago

e2j v1.0.2

Weekly downloads
5
License
ISC
Repository
github
Last release
5 years ago

e2j init

npm or yarn e2j

1、Make sure you have a gulp installed
2、let's get start

数组 array

ABCDEF
(备注 decs)主键姓名成绩三好学生家庭成员
类型intstringobjectboolarray
字段idnamegradeis3Goodfamilys
1小明{math:100,english:80}true[farther,mother,brother]
2小红{math:100,english:80}true[farther,mother,brother]
3小绿{math:100,english:80}true[farther,mother,brother]

gulp e2j =>

[{
    "id": 1,
    "name": "小明",
    "grade": {
        "math": 100,
        "english": 80
    },
    "is3Good": true,
    "familys": ["farther", "mother", "brother"]
}, {
    "id": 1,
    "name": "小红",
    "grade": {
        "math": 100,
        "english": 80
    },
    "is3Good": true,
    "familys": ["farther", "mother", "brother"]
}, {
    "id": 1,
    "name": "小绿",
    "grade": {
        "math": 100,
        "english": 80
    },
    "is3Good": true,
    "familys": ["farther", "mother", "brother"]
}]

对象 object

ABCDEF
(备注 decs)主键姓名成绩三好学生家庭成员
类型intstringobjectboolarray
\$keyidnamegradeis3Goodfamilys
xiaoming1小明{math:100,english:80}true[farther,mother,brother]
xiaohong2小红{math:100,english:80}true[farther,mother,brother]
xiaolv3小绿{math:100,english:80}true[farther,mother,brother]

gulp e2j =>

{
    "xiaoming": {
        "id": 1,
        "name": "小明",
        "grade": {
            "math": 100,
            "english": 80
        },
        "is3Good": true,
        "familys": ["farther", "mother", "brother"]
    },
    "xiaohong": {
        "id": 1,
        "name": "小红",
        "grade": {
            "math": 100,
            "english": 80
        },
        "is3Good": true,
        "familys": ["farther", "mother", "brother"]
    },
    "xiaolv": {
        "id": 1,
        "name": "小绿",
        "grade": {
            "math": 100,
            "english": 80
        },
        "is3Good": true,
        "familys": ["farther", "mother", "brother"]
    }
}

example =>

var e2j = require('e2j');

gulp.task('e2j', function () {
    gulp.src('config/**.xlsx')
        .pipe(e2j({
            trace: true
        }))
        .pipe(rename((path) => {
            path.extname = ".json";
        }))
        .pipe(gulp.dest('excel'))
});

gulp e2j
1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago