remove broken CDNs [ci skip]

This commit is contained in:
reviewher 2022-03-22 15:19:52 -07:00
parent 0f0b3de821
commit e69ecd42a6
10 changed files with 37 additions and 50 deletions

@ -13,7 +13,6 @@ port calculations to web apps; automate common spreadsheet tasks, and much more!
[![Build Status](https://img.shields.io/github/workflow/status/sheetjs/sheetjs/Tests:%20node.js)](https://github.com/SheetJS/sheetjs/actions)
[![Snyk Vulnerabilities](https://img.shields.io/snyk/vulnerabilities/github/SheetJS/sheetjs)](https://snyk.io/test/github/SheetJS/sheetjs)
[![npm Downloads](https://img.shields.io/npm/dm/xlsx.svg)](https://npmjs.org/package/xlsx)
[![jsDelivr Downloads](https://data.jsdelivr.com/v1/package/npm/xlsx/badge)](https://www.jsdelivr.com/package/npm/xlsx)
[![Analytics](https://ga-beacon.appspot.com/UA-36810333-1/SheetJS/sheetjs?pixel)](https://github.com/SheetJS/sheetjs)
[**Browser Test and Support Matrix**](https://oss.sheetjs.com/sheetjs/tests/)
@ -134,7 +133,6 @@ can be directly added to a page with a `script` tag:
| `unpkg` | <https://unpkg.com/xlsx/> |
| `jsDelivr` | <https://jsdelivr.com/package/npm/xlsx> |
| `CDNjs` | <https://cdnjs.com/libraries/xlsx> |
| `packd` | <https://bundle.run/xlsx@latest?name=XLSX> |
For example, `unpkg` makes the latest version available at:
@ -195,14 +193,14 @@ set_cptable(cptable);
**Deno**
The [`sheetjs`](https://deno.land/x/sheetjs) package is hosted by Deno:
`xlsx.mjs` can be imported in Deno. It is available from `unpkg`:
```ts
// @deno-types="https://deno.land/x/sheetjs/types/index.d.ts"
import * as XLSX from 'https://deno.land/x/sheetjs/xlsx.mjs'
// @deno-types="https://unpkg.com/xlsx/types/index.d.ts"
import * as XLSX from 'https://unpkg.com/xlsx/xlsx.mjs';
/* load the codepage support library for extended support with older formats */
import * as cptable from 'https://deno.land/x/sheetjs/dist/cpexcel.full.mjs';
import * as cptable from 'https://unpkg.com/xlsx/dist/cpexcel.full.mjs';
XLSX.set_cptable(cptable);
```

@ -1,4 +1,4 @@
TESTS= x mjs jspm
TESTS= x mjs
UNSTABLE= node
TEST_FILES=number_format_greek.xls

@ -3,24 +3,28 @@
Deno is a runtime capable of running JS code including this library. There are
a few different builds and recommended use cases as covered in this demo.
For user code, [the `sheetjs` module](https://deno.land/x/sheetjs) can be used.
Due to ongoing stability and sync issues with the Deno registry, scripts should
use [the `unpkg` CDN build](https://unpkg.com/xlsx/xlsx.mjs):
```js
// @deno-types="https://unpkg.com/xlsx/types/index.d.ts"
import * as XLSX from 'https://unpkg.com/xlsx/xlsx.mjs';
/* load the codepage support library for extended support with older formats */
import * as cptable from 'https://unpkg.com/xlsx/dist/cpexcel.full.mjs';
XLSX.set_cptable(cptable);
```
## Reading and Writing Files
In general, the command-line flag `--allow-read` must be passed to enable file
reading. The flag `--allow-write` must be passed to enable file writing.
Starting in version 0.18.1, this library will check for the `Deno` global and
use `Deno.readFileSync` and `Deno.writeFileSync` behind the scenes.
For older versions, the API functions must be called from user code.
_Reading a File_
```ts
const filedata = Deno.readFileSync("test.xlsx");
const workbook = XLSX.read(filedata, {type: "buffer"});
/* DO SOMETHING WITH workbook HERE */
const workbook = XLSX.readFile("test.xlsx");
```
_Writing a File_
@ -30,9 +34,7 @@ Older versions of the library did not properly detect features from Deno, so the
not handle byte arrays, user code must generate a `Uint8Array` first:
```ts
const buf = XLSX.write(workbook, {type: "buffer", bookType: "xlsb"});
const u8: Uint8Array = new Uint8Array(buf);
Deno.writeFileSync("test.xlsb", u8);
XLSX.writeFile(workbook, "test.xlsb");
```
## Demos
@ -60,8 +62,8 @@ accepts the `XLSX` module as an argument.
- `x` imports the ESM build without the codepage library:
```ts
// @deno-types="https://deno.land/x/sheetjs/types/index.d.ts"
import * as XLSX from 'https://deno.land/x/sheetjs/xlsx.mjs';
// @deno-types="https://unpkg.com/xlsx/types/index.d.ts"
import * as XLSX from 'https://unpkg.com/xlsx/xlsx.mjs';
```
- `mjs` imports the ESM build and the associated codepage library:
@ -73,12 +75,6 @@ import * as cptable from '../../dist/cptable.full.mjs';
XLSX.set_cptable(cptable);
```
- `jspm` imports the browser standalone script using JSPM:
```ts
import * as XLSX from 'https://jspm.dev/npm:xlsx!cjs';
```
- `node` uses the node compatibility layer:
```ts

@ -1,4 +0,0 @@
import * as XLSX from 'https://jspm.dev/npm:xlsx!cjs'
import doit from './doit.ts';
doit(XLSX, "jspm");

@ -1,7 +1,7 @@
/*! 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';
// @deno-types="https://unpkg.com/xlsx/types/index.d.ts"
import * as XLSX from 'https://unpkg.com/xlsx/xlsx.mjs';
import * as cptable from 'https://unpkg.com/xlsx/dist/cpexcel.full.mjs';
XLSX.set_cptable(cptable);
const filename = Deno.args[0];

@ -1,4 +1,5 @@
import * as XLSX from 'https://deno.land/x/sheetjs/xlsx.mjs';
// @deno-types="https://unpkg.com/xlsx/types/index.d.ts"
import * as XLSX from 'https://unpkg.com/xlsx/xlsx.mjs';
import doit from './doit.ts';
doit(XLSX, "x");

@ -1,7 +1,7 @@
/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */
// @deno-types="https://deno.land/x/sheetjs/types/index.d.ts"
import { read, utils, set_cptable } from 'https://deno.land/x/sheetjs@v0.18.3/xlsx.mjs';
import * as cptable from 'https://deno.land/x/sheetjs/dist/cpexcel.full.mjs';
// @deno-types="https://unpkg.com/xlsx/types/index.d.ts"
import { read, utils, set_cptable } from 'https://unpkg.com/xlsx/xlsx.mjs';
import * as cptable from 'https://unpkg.com/xlsx/dist/cpexcel.full.mjs';
set_cptable(cptable);
import * as Drash from "https://deno.land/x/drash@v2.5.4/mod.ts";

@ -13,7 +13,6 @@ port calculations to web apps; automate common spreadsheet tasks, and much more!
[![Build Status](https://img.shields.io/github/workflow/status/sheetjs/sheetjs/Tests:%20node.js)](https://github.com/SheetJS/sheetjs/actions)
[![Snyk Vulnerabilities](https://img.shields.io/snyk/vulnerabilities/github/SheetJS/sheetjs)](https://snyk.io/test/github/SheetJS/sheetjs)
[![npm Downloads](https://img.shields.io/npm/dm/xlsx.svg)](https://npmjs.org/package/xlsx)
[![jsDelivr Downloads](https://data.jsdelivr.com/v1/package/npm/xlsx/badge)](https://www.jsdelivr.com/package/npm/xlsx)
[![Analytics](https://ga-beacon.appspot.com/UA-36810333-1/SheetJS/sheetjs?pixel)](https://github.com/SheetJS/sheetjs)
[**Browser Test and Support Matrix**](https://oss.sheetjs.com/sheetjs/tests/)

@ -19,7 +19,6 @@ can be directly added to a page with a `script` tag:
| `unpkg` | <https://unpkg.com/xlsx/> |
| `jsDelivr` | <https://jsdelivr.com/package/npm/xlsx> |
| `CDNjs` | <https://cdnjs.com/libraries/xlsx> |
| `packd` | <https://bundle.run/xlsx@latest?name=XLSX> |
For example, `unpkg` makes the latest version available at:
@ -80,14 +79,14 @@ set_cptable(cptable);
**Deno**
The [`sheetjs`](https://deno.land/x/sheetjs) package is hosted by Deno:
`xlsx.mjs` can be imported in Deno. It is available from `unpkg`:
```ts
// @deno-types="https://deno.land/x/sheetjs/types/index.d.ts"
import * as XLSX from 'https://deno.land/x/sheetjs/xlsx.mjs'
// @deno-types="https://unpkg.com/xlsx/types/index.d.ts"
import * as XLSX from 'https://unpkg.com/xlsx/xlsx.mjs';
/* load the codepage support library for extended support with older formats */
import * as cptable from 'https://deno.land/x/sheetjs/dist/cpexcel.full.mjs';
import * as cptable from 'https://unpkg.com/xlsx/dist/cpexcel.full.mjs';
XLSX.set_cptable(cptable);
```

@ -13,7 +13,6 @@ port calculations to web apps; automate common spreadsheet tasks, and much more!
[![Build Status](https://img.shields.io/github/workflow/status/sheetjs/sheetjs/Tests:%20node.js)](https://github.com/SheetJS/sheetjs/actions)
[![Snyk Vulnerabilities](https://img.shields.io/snyk/vulnerabilities/github/SheetJS/sheetjs)](https://snyk.io/test/github/SheetJS/sheetjs)
[![npm Downloads](https://img.shields.io/npm/dm/xlsx.svg)](https://npmjs.org/package/xlsx)
[![jsDelivr Downloads](https://data.jsdelivr.com/v1/package/npm/xlsx/badge)](https://www.jsdelivr.com/package/npm/xlsx)
[![Analytics](https://ga-beacon.appspot.com/UA-36810333-1/SheetJS/sheetjs?pixel)](https://github.com/SheetJS/sheetjs)
[**Browser Test and Support Matrix**](https://oss.sheetjs.com/sheetjs/tests/)
@ -129,7 +128,6 @@ can be directly added to a page with a `script` tag:
| `unpkg` | <https://unpkg.com/xlsx/> |
| `jsDelivr` | <https://jsdelivr.com/package/npm/xlsx> |
| `CDNjs` | <https://cdnjs.com/libraries/xlsx> |
| `packd` | <https://bundle.run/xlsx@latest?name=XLSX> |
For example, `unpkg` makes the latest version available at:
@ -186,14 +184,14 @@ set_cptable(cptable);
**Deno**
The [`sheetjs`](https://deno.land/x/sheetjs) package is hosted by Deno:
`xlsx.mjs` can be imported in Deno. It is available from `unpkg`:
```ts
// @deno-types="https://deno.land/x/sheetjs/types/index.d.ts"
import * as XLSX from 'https://deno.land/x/sheetjs/xlsx.mjs'
// @deno-types="https://unpkg.com/xlsx/types/index.d.ts"
import * as XLSX from 'https://unpkg.com/xlsx/xlsx.mjs';
/* load the codepage support library for extended support with older formats */
import * as cptable from 'https://deno.land/x/sheetjs/dist/cpexcel.full.mjs';
import * as cptable from 'https://unpkg.com/xlsx/dist/cpexcel.full.mjs';
XLSX.set_cptable(cptable);
```