Skip to content
This repository has been archived by the owner on Dec 5, 2017. It is now read-only.

Commit

Permalink
version bump 0.4.4: XLSX 0.8.6 HARB 0.1.1
Browse files Browse the repository at this point in the history
- XLSX export ODS/BIFF2/FODS/js arrays
- HARB export dif/sylk
- infrastructure improvements
  • Loading branch information
SheetJSDev committed Mar 4, 2017
1 parent 22e3bd5 commit c3a30ff
Show file tree
Hide file tree
Showing 13 changed files with 1,134 additions and 973 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
test_files/
tmp/
misc/coverage.html
13 changes: 10 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
language: node_js
node_js:
- "0.10.30"
- "7"
- "6"
- "5"
- "4"
- "0.12"
- "0.10"
- "0.9"
- "0.8"
- "0.11"
before_install:
- "npm install -g mocha xlsjs xlsx"
- "npm install -g npm@4.3.0"
- "npm install -g mocha@2.x voc"
- "npm install blanket"
- "npm install xlsjs xlsx"
- "npm install coveralls mocha-lcov-reporter"
before_script:
- "make init"
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 2013-2014 SheetJS
Copyright (C) 2013-present SheetJS

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
63 changes: 45 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
TARGET=j.js
FMT=xls xml xlsx xlsm xlsb csv slk dif txt ods misc
SHELL=/bin/bash
LIB=j
FMT=xlsx xlsm xlsb ods xls xml csv slk dif txt dbf misc
REQS=
ADDONS=
AUXTARGETS=
CMDS=bin/j.njs
HTMLLINT=

TARGET=$(LIB).js
UGLIFYOPTS=--support-ie8

## Main Targets

.PHONY: init
init:
bash init.sh

.PHONY: clean
clean:
if [ -e test_files ]; then rm -f test_files/*__.x*; fi
rm -f tmp/*__.*

.PHONY: test mocha
test mocha: test.js
mocha -R spec -t 10000
test mocha: test.js ## Run test suite
mocha -R spec -t 20000

#* To run tests for one format, make test_<fmt>
TESTFMT=$(patsubst %,test_%,$(FMT))
.PHONY: $(TESTFMT)
$(TESTFMT): test_%:
Expand All @@ -25,27 +38,41 @@ $(TESTFMT): test_%:
numbers:
./tests/open_numbers.sh

## Code Checking

.PHONY: lint
lint: $(TARGET)
jshint --show-non-errors $(TARGET)
jscs $(TARGET)
lint: $(TARGET) $(AUXTARGETS) ## Run jshint and jscs checks
@jshint --show-non-errors $(TARGET) $(AUXTARGETS)
@jshint --show-non-errors $(CMDS)
@jshint --show-non-errors package.json
@jshint --show-non-errors --extract=always $(HTMLLINT)
@jscs $(TARGET) $(AUXTARGETS)

.PHONY: cov cov-spin
cov: misc/coverage.html
cov-spin:
make cov & bash misc/spin.sh $$!
.PHONY: flow
flow: lint ## Run flow checker
@flow check --all --show-all-errors

.PHONY: cov
cov: misc/coverage.html ## Run coverage test

#* To run coverage tests for one format, make cov_<fmt>
COVFMT=$(patsubst %,cov_%,$(FMT))
.PHONY: $(COVFMT)
$(COVFMT): cov_%:
FMTS=$* make cov

misc/coverage.html: $(TARGET) test.js
mocha --require blanket -R html-cov > $@
mocha --require blanket -R html-cov -t 20000 > $@

.PHONY: coveralls
coveralls: ## Coverage Test + Send to coveralls.io
mocha --require blanket --reporter mocha-lcov-reporter -t 20000 | node ./node_modules/coveralls/bin/coveralls.js


.PHONY: coveralls coveralls-spin
coveralls:
mocha --require blanket --reporter mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
.PHONY: help
help:
@grep -hE '(^[a-zA-Z_-][ a-zA-Z_-]*:.*?|^#[#*])' $(MAKEFILE_LIST) | bash misc/help.sh

coveralls-spin:
make coveralls & bash misc/spin.sh $$!
#* To show a spinner, append "-spin" to any target e.g. cov-spin
%-spin:
@make $* & bash misc/spin.sh $$!
80 changes: 49 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,56 @@
# J

Simple data wrapper that attempts to wrap SheetJS libraries to provide a uniform way to access data from Excel and other spreadsheet files:
Simple data wrapper that attempts to wrap SheetJS libraries to provide a uniform
way to access data from Excel and other spreadsheet files:

- JS-XLS: [xlsjs on npm](http://npm.im/xlsjs)
- JS-XLSX: [xlsx on npm](http://npm.im/xlsx)
- JS-HARB: [harb on npm](http://npm.im/harb)

Excel files are parsed based on the content (not by filename). For example, CSV files can be renamed to .XLS and excel will do the right thing.
Excel files are parsed based on the content (not by filename). For example, CSV
files can be renamed to .XLS and excel will do the right thing.

Supported Formats:

| Format | Library |
| :---------------------- | :------ |
| XLS (BIFF5, 5.0-7.0) | JS-XLS |
| XLS (BIFF8, 97-2003) | JS-XLS |
| XLSX (2007+) | JS-XLSX |
| XLSM (2007+ w/macros) | JS-XLSX |
| XLSB (2007+ binary) | JS-XLSX |
| XML (2003/2004) | JS-XLS |
| DIF (plaintext) | JS-HARB |
| UTF-16 Text | JS-HARB |
| CSV / TSV | JS-HARB |
| SYLK (Symbolic Link) | JS-HARB |
| ODS (OpenDocument) | JS-XLSX |
| SocialCalc | JS-HARB |

Output formats:

- XML and HTML work with [Excel Web Query](http://office.microsoft.com/en-us/excel-help/get-and-analyze-data-from-the-web-in-excel-HA001054848.aspx)
- DSV (general delimiters, including CSV and TSV)
- JSON
- Formulae list (e.g. `A1=NOW()`, `A2=A1+3`)
- XLSX / XLSM work with iOS Numbers and Excel
- Markdown tables (GFM style)
- SocialCalc output
| Format | Read | Write |
|:-------------------------------------------------------------|:-----:|:-----:|
| **Excel Worksheet/Workbook Formats** |:-----:|:-----:|
| Excel 2007+ XML Formats (XLSX/XLSM) | :o: | :o: |
| Excel 2007+ Binary Format (XLSB BIFF12) | :o: | :o: |
| Excel 2003-2004 XML Format (XML "SpreadsheetML") | :o: | |
| Excel 97-2004 (XLS BIFF8) | :o: | |
| Excel 5.0/95 (XLS BIFF5) | :o: | |
| Excel 4.0 (XLS/XLW BIFF4) | :o: | |
| Excel 3.0 (XLS BIFF3) | :o: | |
| Excel 2.0/2.1 (XLS BIFF2) | :o: | :o: |
| **Excel Supported Text Formats** |:-----:|:-----:|
| Delimiter-Separated Values (CSV/TSV/DSV) | :o: | :o: |
| Data Interchange Format (DIF) | :o: | :o: |
| Symbolic Link (SYLK/SLK) | :o: | :o: |
| Space-Delimited Text (PRN) | :o: | |
| UTF-16 Unicode Text (TXT) | :o: | |
| **Other Workbook/Worksheet Formats** |:-----:|:-----:|
| OpenDocument Spreadsheet (ODS) | :o: | :o: |
| Flat XML ODF Spreadsheet (FODS) | :o: | :o: |
| Uniform Office Format Spreadsheet (标文通 UOS1/UOS2) | :o: | |
| dBASE II/III/IV / Visual FoxPro (DBF) | :o: | |
| **Other Common Spreadsheet Output Formats** |:-----:|:-----:|
| HTML Tables | | :o: |
| Markdown Tables | | :o: |
| **Other Output Formats** |:-----:|:-----:|
| XML Data (XML) | | :o: |
| SocialCalc | :o: | :o: |


## Installation

```
npm install -g j
```bash
$ npm install -g j
```

## Node Library

```
```js
var J = require('j');
```

Expand All @@ -68,7 +75,7 @@ The node module ships with a binary `j` which has a help message:
```
$ j --help
Usage: j [options] <file> [sheetname]
Usage: j.njs [options] <file> [sheetname]
Options:
Expand All @@ -77,21 +84,32 @@ $ j --help
-f, --file <file> use specified file (- for stdin)
-s, --sheet <sheet> print specified sheet (default first sheet)
-N, --sheet-index <idx> use specified sheet index (0-based)
-p, --password <pw> if file is encrypted, try with specified pw
-l, --list-sheets list sheet names and exit
-o, --output <file> output to specified file
-B, --xlsb emit XLSB to <sheetname> or <file>.xlsb
-M, --xlsm emit XLSM to <sheetname> or <file>.xlsm
-X, --xlsx emit XLSX to <sheetname> or <file>.xlsx
-Y, --ods emit ODS to <sheetname> or <file>.ods
-2, --biff2 emit XLS to <sheetname> or <file>.xls (BIFF2)
-T, --fods emit FODS to <sheetname> or <file>.fods (Flat ODS)
-S, --formulae print formulae
-j, --json emit formatted JSON (all fields text)
-J, --raw-js emit raw JS object (raw numbers)
-A, --arrays emit rows as JS objects (raw numbers)
-x, --xml emit XML
-H, --html emit HTML
-m, --markdown emit markdown table (with pipes)
-m, --markdown emit markdown table
-D, --dif emit data interchange format (dif)
-K, --sylk emit symbolic link (sylk)
-E, --socialcalc emit socialcalc
-F, --field-sep <sep> CSV field separator
-R, --row-sep <sep> CSV row separator
-n, --sheet-rows <num> Number of rows to process (0=all rows)
--sst generate shared string table for XLS* formats
--compress use compression when writing XLSX/M/B and ODS
--perf do not generate output
--all parse everything
--dev development mode
--read read but do not print out contents
-q, --quiet quiet mode
Expand Down
Loading

0 comments on commit c3a30ff

Please sign in to comment.