Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinChen committed Oct 10, 2020
1 parent ce29008 commit 2361684
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 32 deletions.
4 changes: 3 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# excel-export #
# excel-export2 #

引用:[https://github.com/functionscope/Node-Excel-Export](https://github.com/functionscope/Node-Excel-Export)

A simple node.js module for exporting data set to Excel xlsx file.

## Using excel-export ##
Expand Down
6 changes: 3 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "Excel-export",
"name": "excel-export-example",
"description": "Node Excel Export test app",
"version": "0.3.1",
"private": true,
"dependencies": {
"excel-export": "0.3.9",
"excel-export2": "0.5.2",
"express": "3.x",
"node-uuid": "^1.4.1",
"node-zip": "1.x"
"jszip": "^2.6.0"
}
}
27 changes: 10 additions & 17 deletions index.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"name": "excel-export",
"version": "0.5.1",
"name": "excel-export2",
"version": "0.5.2",
"description": "Simple data set export to Excel xlsx file",
"main": "index.js",
"scripts": {
"test": "mocha test/main"
},
"repository": "https://github.com/functionscope/Node-Excel-Export",
"repository": "https://github.com/chendong0120/Node-Excel-Export",
"keywords": [
"Excel",
"xlsx"
],
"author": "Ber-Lin Lai <berlin.lai@gmail.com>",
"author": "Kevin Chen <chendong0120@outlook.com>",
"license": "BSD",
"dependencies": {
"collections": "^3.0.0",
"node-zip": "1.x"
"collections": "^5.1.12",
"jszip": "^2.6.0"
},
"devDependencies": {
"mocha": "",
Expand Down
11 changes: 6 additions & 5 deletions sheet.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
var sheetFront = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><x:worksheet xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main">'
+ ' <x:sheetPr/><x:sheetViews><x:sheetView tabSelected="1" workbookViewId="0" /></x:sheetViews>'
+ ' <x:sheetFormatPr defaultRowHeight="15" />';
var sheetFront = '<?xml version="1.0" encoding="utf-8"?><x:worksheet xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main" '
+ 'xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">'
+ ' <x:sheetPr/><x:sheetViews><x:sheetView tabSelected="1" workbookViewId="0" /></x:sheetViews>'
+ ' <x:sheetFormatPr defaultRowHeight="15" />';
var sheetBack =' <x:pageMargins left="0.75" right="0.75" top="0.75" bottom="0.5" header="0.5" footer="0.75" />'
+ ' <x:headerFooter /></x:worksheet>';

var fs = require('fs');

function Sheet(config, xlsx, shareStrings, convertedShareStrings){
this.config = config;
this.xlsx = xlsx;
this.shareStrings = shareStrings;
this.convertedShareStrings = convertedShareStrings;
this.convertedShareStrings = convertedShareStrings;
}

Sheet.prototype.generate = function(){
Expand Down
8 changes: 8 additions & 0 deletions test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
var should = require('should');
var nodeExcel = require('../index');

Date.prototype.getJulian = function() {
return Math.floor((this / 86400000) - (this.getTimezoneOffset() / 1440) + 2440587.5);
};

Date.prototype.oaDate = function() {
return (this - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
};

describe('Simple Excel xlsx Export', function() {
describe('Export', function() {
it('returns xlsx', function() {
Expand Down

0 comments on commit 2361684

Please sign in to comment.