-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46360a1
commit fbdd43a
Showing
26 changed files
with
5,131 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: 'Tests: deno 1.x' | ||
|
||
on: [pull_request, push] | ||
|
||
jobs: | ||
# small test | ||
misc: | ||
runs-on: ubuntu-latest | ||
env: | ||
FMTS: misc | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: denoland/setup-deno@main | ||
with: | ||
deno-version: v1.x | ||
- uses: ljharb/actions/node/install@main | ||
with: | ||
node-version: '16.' | ||
- run: sudo curl -Lo /usr/bin/rooster https://github.com/SheetJS/rooster/releases/download/v0.2.0/rooster-v0.2.0-linux-amd64 | ||
- run: sudo chmod a+x /usr/bin/rooster | ||
- run: make init | ||
- run: 'cd test_files; make all; cd -' | ||
- run: deno test --allow-env --allow-read --allow-write test.ts | ||
# full test | ||
full: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: denoland/setup-deno@main | ||
with: | ||
deno-version: v1.x | ||
- uses: ljharb/actions/node/install@main | ||
with: | ||
node-version: '16.' | ||
- run: sudo curl -Lo /usr/bin/rooster https://github.com/SheetJS/rooster/releases/download/v0.2.0/rooster-v0.2.0-linux-amd64 | ||
- run: sudo chmod a+x /usr/bin/rooster | ||
- run: make init | ||
- run: 'cd test_files; make all; cd -' | ||
- run: deno test --allow-env --allow-read --allow-write test.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sheet2csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */ | ||
// @deno-types="https://deno.land/x/sheetjs/types/index.d.ts" | ||
import * as XLSX from 'https://deno.land/x/sheetjs/xlsx.mjs'; | ||
import * as cptable from 'https://deno.land/x/sheetjs/dist/cpexcel.full.mjs'; | ||
XLSX.set_cptable(cptable); | ||
|
||
const filename = Deno.args[0]; | ||
if(!filename) { | ||
console.error("usage: sheet2csv <filename> [sheetname]"); | ||
Deno.exit(1); | ||
} | ||
|
||
const workbook = XLSX.readFile(filename); | ||
const sheetname = Deno.args[1] || workbook.SheetNames[0]; | ||
|
||
if(!workbook.Sheets[sheetname]) { | ||
console.error(`error: workbook missing sheet ${sheetname}`); | ||
Deno.exit(1); | ||
} | ||
|
||
console.log(XLSX.utils.sheet_to_csv(workbook.Sheets[sheetname])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.