Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
Sambo Chea | f65301ce4d | ||
Sambo Chea | 2b170c9bc0 | ||
Sambo Chea | 88645b98ea |
|
@ -1,4 +1,4 @@
|
|||
# excel2json
|
||||
# excel2json-xlsx
|
||||
[![Node.js Package](https://github.com/CUBETIQ/excel2json/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/CUBETIQ/excel2json/actions/workflows/npm-publish.yml)
|
||||
[![Docker CI](https://github.com/CUBETIQ/excel2json/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/CUBETIQ/excel2json/actions/workflows/docker-publish.yml)
|
||||
![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/cubetiq/excel2json)
|
||||
|
@ -27,7 +27,7 @@ excel2json-xlsx -i source.xlsx -o exported.json
|
|||
```
|
||||
OR
|
||||
```shell
|
||||
npx excel2json -i source.xlsx -o exported.json
|
||||
npx excel2json-xlsx -i source.xlsx -o exported.json
|
||||
```
|
||||
|
||||
# [Docker Hub](https://hub.docker.com/r/cubetiq/excel2json)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const yargs = require("yargs");
|
||||
const excel2json = require("./../excel2json");
|
||||
const excel2json = require("./../index");
|
||||
|
||||
const options = yargs
|
||||
.usage("Usage: -i <input> -o <output> -m <mapper>")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
interface Excel2JsonProps {
|
||||
export interface Excel2JsonProps {
|
||||
mappings?: Array<any>;
|
||||
saveToOutput?: boolean;
|
||||
outputPath?: string;
|
||||
|
@ -10,4 +10,4 @@ interface Excel2JsonProps {
|
|||
encoding?: string;
|
||||
}
|
||||
|
||||
declare function excel2json(props: Excel2JsonProps);
|
||||
export declare function excel2json(props: Excel2JsonProps);
|
||||
|
|
|
@ -105,7 +105,7 @@ function _internalExport(props = {}) {
|
|||
console.log("Exported excel to json to output =>", outFile);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
|
@ -117,6 +117,6 @@ function _internalExport(props = {}) {
|
|||
*
|
||||
* @returns JSON Object of result
|
||||
*/
|
||||
module.exports = excel2json = (props = {}) => {
|
||||
module.exports.excel2json = excel2json = (props = {}) => {
|
||||
return _internalExport(props);
|
||||
};
|
||||
|
|
11
index.js
11
index.js
|
@ -1,10 +1,5 @@
|
|||
// import excel2json module
|
||||
const excel2json = require("./excel2json");
|
||||
const { excel2json } = require("./excel2json");
|
||||
|
||||
// called function export excel2json
|
||||
const exported = excel2json({
|
||||
inputFile: "./data/source.xlsx"
|
||||
});
|
||||
|
||||
// output data from exported
|
||||
console.log("Output =>\n", exported);
|
||||
// export the function
|
||||
module.exports = excel2json;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "excel2json-xlsx",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.6",
|
||||
"keywords": [
|
||||
"excel",
|
||||
"json",
|
||||
|
@ -11,7 +11,7 @@
|
|||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"bin": "bin/cli.js",
|
||||
"bin": "./bin/cli.js",
|
||||
"description": "Excel to JSON, able to export JSON from Excel (xlsx)",
|
||||
"repository": {
|
||||
"url": "https://github.com/CUBETIQ/excel2json.git"
|
||||
|
|
Loading…
Reference in New Issue
Block a user