XLSXParser
The XLSXParser can parsing Microsoft Excel and Google Spreadsheet.
Installation
npm install --save xlsx-parser
Usage
Quick start
excel
example sheet.xlsx
| A | B | C | D |
---|
1 | key | name | number | other |
2 | aa1 | cat | 1 | |
3 | bb1 | dog | 2 | sleep |
4 | cc1 | mouse | 3 | run |
Sheet1 | | | | |
var xlsxParser = require('xlsx-parser');
var opts = { sheets: [ 1 ] };
elsxPaser.excel.parse('./sheet.xlsx', opts, function(err, result) {
console.log(result);
});
spreadsheet
example spreadsheet
| A | B | C | D |
---|
1 | key | name | number | other |
2 | aa1 | cat | 1 | |
3 | bb1 | dog | 2 | sleep |
4 | cc1 | mouse | 3 | run |
Sheet1 | | | | |
var xlsxParser = require('xlsx-parser');
xlsxPaeser.spreadsheet.setup({
api: {
client_id: 'YOUR CLIENT ID HERE',
client_secret: 'YOUR CLIENT SECRET HERE',
redirect_url: 'http://localhost',
token_path: './dist/token.json'
}
});
var SPREADSHEET_KEY = '1YXVzaaxqkPKsr-excIOXScnTQC7y_DKrUKs0ukzSIgo';
var opts = { sheets: [ 'od6' ] };
elsxPaser.spreadsheet.parse(SPREADSHEET_KEY, opts, function(err, result) {
console.log(result);
});
Contribution
- Fork it ( https://github.com/iyu/xlsx-parser/fork )
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
npm test; npm run-script jshint
command and confirm that it passes - Create new Pull Request