4.0.0 • Published 4 years ago
xl-json v4.0.0
#xl-json
Converts a complete excel spreadsheet to json in either object, as file or stream to a pipeline. Module only works for nodejs version 4 or higher
Install
npm install xl-json
Example
const Converter = require('xl-json');
const options = {
input: Path.resolve(__dirname, './test/excel/relationship.xlsx'),
output: '../output/relationship',
spacer: 2, // optional for JSON.stringify
replacer: ['key'] // optional array or function to be passed to JSON.stringify
formatter: {
organisation: formatter
} // optional object with keys representing the name of sheet within workbook you would like to format and the value is a function that takes one parameter which is an array of objects. Defaults to standard format which doesn't affect parsing done by j module
};
const results = new Converter(options);
// return json stringified object with keys of object being the worksheet name
const jsonObj = results.toJson();
// Also exposes a stream which can be written or piped somewhere
results.streamSheet('customer').pipe(process.stdout);
results.streamBook().pipe(process.stdout);
Cli usage
xl-json
-i
,--i
or--input
to set the input path of excel file to be converted-o
,--o
or--ouput
to select the destination for converted json to be written to-f
,--f
or--formatters
location of formatters object to be used to parse excel-v
,--v
or--version
will display the current version of package-h
- will show usage of cli
###Todo
- Add ability to parse, write and stream multiple spreadsheets
4.0.0
4 years ago
3.3.2
9 years ago
3.3.1
9 years ago
3.3.0
9 years ago
3.2.3
10 years ago
3.2.2
10 years ago
3.2.1
10 years ago
3.2.0
10 years ago
3.1.0
10 years ago
3.0.0
10 years ago
2.0.0
10 years ago
1.3.0
10 years ago
1.2.0
10 years ago
1.1.1
10 years ago
1.0.1
10 years ago
0.0.5
10 years ago
0.0.4
10 years ago
0.0.1
10 years ago