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.3.14: node v0.10.31 error
Browse files Browse the repository at this point in the history
j now throws an error when `require`d in node v0.10.31.  See:

- #4
- SheetJS/sheetjs#100
- SheetJS/sheetjs#106
- nodejs/node-v0.x-archive#8208
- nodejs/node-v0.x-archive#8320
  • Loading branch information
SheetJSDev committed Sep 5, 2014
1 parent 6f383ca commit 8ce6239
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,10 @@ git config --global diff.sheetjs.textconv "j -S"

NOTE: There are some known issues regarding global modules in Windows. The best
bet is to `npm install j` in your git directory before diffing.

## Notes

Segmentation faults in node v0.10.31 stem from a bug in node. J will throw an
error if it is running under that version. Since versions prior to v0.10.30 do
not exhibit the problem, rolling back to a previous version of node is the best
remedy. See <https://github.com/joyent/node/issues/8208> for more information.
11 changes: 0 additions & 11 deletions bin/j.njs
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,6 @@ program.on('--help', function() {

program.parse(process.argv);

/* see https://github.com/SheetJS/j/issues/4 */
if(process.version === 'v0.10.31') {
var msgs = [
"node v0.10.31 is known to crash on OSX and Linux, refusing to proceed.",
"see https://github.com/SheetJS/j/issues/4 for the relevant discussion.",
"see https://github.com/joyent/node/issues/8208 for the relevant node issue"
];
msgs.forEach(function(m) { console.error(m); });
process.exit(1);
}

var filename, sheetname = '';
if(program.args[0]) {
filename = program.args[0];
Expand Down
16 changes: 15 additions & 1 deletion j.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ var to_xlsx = to_xlsx_factory('xlsx');
var to_xlsm = to_xlsx_factory('xlsm');
var to_xlsb = to_xlsx_factory('xlsb');

module.exports = {
var J = {
XLSX: XLSX,
XLS: XLS,
readFile:readFileSync,
Expand All @@ -229,3 +229,17 @@ module.exports = {
},
version: "XLS " + XLS.version + " ; XLSX " + XLSX.version
};

if(typeof module !== 'undefined') module.exports = J;
if(typeof process !== 'undefined') {
/* see https://github.com/SheetJS/j/issues/4 */
if(process.version === 'v0.10.31') {
var msgs = [
"node v0.10.31 is known to crash on OSX and Linux, refusing to proceed.",
"see https://github.com/SheetJS/j/issues/4 for the relevant discussion.",
"see https://github.com/joyent/node/issues/8208 for the relevant node issue"
];
msgs.forEach(function(m) { console.error(m); });
throw "node v0.10.31 bug";
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "j",
"version": "0.3.13",
"version": "0.3.14",
"author": "sheetjs",
"description": "CLI tool for working with XLS/XLSX/XLSM/XLSB files",
"keywords": [ "excel", "xls", "xlsx", "xlsm", "xlsb", "office", "spreadsheet" ],
Expand Down

0 comments on commit 8ce6239

Please sign in to comment.