4.0.0 • Published 3 years ago

xl-json v4.0.0

Weekly downloads
2
License
BSD-3-Clause
Repository
github
Last release
3 years ago

#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

Current Version dependency Status devDependency Status Build Status Coveralls

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

3 years ago

3.3.2

8 years ago

3.3.1

8 years ago

3.3.0

8 years ago

3.2.3

8 years ago

3.2.2

8 years ago

3.2.1

8 years ago

3.2.0

8 years ago

3.1.0

8 years ago

3.0.0

8 years ago

2.0.0

9 years ago

1.3.0

9 years ago

1.2.0

9 years ago

1.1.1

9 years ago

1.0.1

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.1

9 years ago