3.1.4 • Published 8 years ago
kexcel v3.1.4
kexcel
Manipulate .xlsx files - easy.
Notes and information
Installation
npm install kexcel --save
What KExcel supports
- Reading .xlsx files from a file or a stream
- Pure javascript, works on all operating systems.
Read sheet data and get values from:
- Cells
- Rows
- Whole sheet
Supports creating empty files and sheets
- Set strings / numbers or formulas to cells
- Copy contents from other sheets
- Copy cell styles from other cells
What KExcel does not (yet?)
- Calculations - you may set formulas, but they are only computed the next time you open the file in an spreadsheet editor (e.g. Excel or LibreOffice Calc)
- Styles - Setting custom styles
- Support for other spreadsheet cell types (e.g. date, hours, etc.)
TL;DR Simple Usage Examples
Create a new .xlsx file from scratch
var fs = require('fs');
var kexcel = require('kexcel');
kexcel.new().then(function (wb) {
var sheet = wb.getSheet(0);
sheet.setCellValue(1, 1, 'Hello world!');
return wb.pipe(fs.createWriteStream('output.xlsx'));
});
Modify an existing .xlsx file and send it through a http response (express)
var path = require('path');
var express = require('express');
var app = express();
var kexcel = require('kexcel');
app.get('/', function (req, res) {
kexcel.open(path.join(__dirname, 'example.xlsx')).then(function(workbook) {
var sheet = workbook.getSheet(0);
sheet.setCellValue(1,1,'Hello World!');
sheet.setRow(2, ['Hello', 'even', 'more', 'Worlds']);
sheet.setRow(3, [1, '+', 2, 'equals','=A3+C3']);
res.setHeader('Content-disposition', 'attachment; filename=example.xlsx');
res.setHeader('Content-type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
workbook.pipe(res);
});
});
var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('KExcel app listening at http://%s:%s', host, port);
});
3.1.4
8 years ago
3.1.2
8 years ago
3.1.1
8 years ago
3.1.0
8 years ago
3.0.12
8 years ago
3.0.10
8 years ago
3.0.8
8 years ago
3.0.6
8 years ago
3.0.3
8 years ago
3.0.1
8 years ago
3.0.0
8 years ago
2.0.16
9 years ago
2.0.15
9 years ago
2.0.14
9 years ago
2.0.13
9 years ago
2.0.12
9 years ago
2.0.11
9 years ago
2.0.10
9 years ago
2.0.8
9 years ago
2.0.7
9 years ago
2.0.4
9 years ago
2.0.2
9 years ago
2.0.1
9 years ago
1.2.3
10 years ago
1.2.2
10 years ago
1.2.1
10 years ago
0.9.9
10 years ago
0.9.8
10 years ago
0.9.7
10 years ago
0.9.6
10 years ago
0.9.5
10 years ago
0.9.2
10 years ago
0.9.1
10 years ago
0.8.3
10 years ago
0.8.2
10 years ago