mirror of
https://github.com/asadbek064/hyparquet.git
synced 2025-12-05 22:41:55 +00:00
Publish 1.6.1 - fix type of utils and update the doc (#44)
* Publish 1.6.1 - fix types * update the doc
This commit is contained in:
parent
c85d38eed5
commit
e738643745
11
README.md
11
README.md
@ -73,7 +73,16 @@ Hyparquet supports asynchronous fetching of parquet files over a network.
|
||||
const { asyncBufferFromUrl, parquetRead } = await import('https://cdn.jsdelivr.net/npm/hyparquet/src/hyparquet.min.js')
|
||||
const url = 'https://hyperparam-public.s3.amazonaws.com/bunnies.parquet'
|
||||
await parquetRead({
|
||||
file: await asyncBufferFromUrl(url),
|
||||
file: await asyncBufferFromUrl({url}),
|
||||
onComplete: data => console.log(data)
|
||||
})
|
||||
```
|
||||
|
||||
Pass the `requestInit` option to authenticate, for example:
|
||||
|
||||
```js
|
||||
await parquetRead({
|
||||
file: await asyncBufferFromUrl({url, requestInit: {headers: {Authorization: 'Bearer my_token'}}}),
|
||||
onComplete: data => console.log(data)
|
||||
})
|
||||
```
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hyparquet",
|
||||
"version": "1.6.0",
|
||||
"version": "1.6.1",
|
||||
"description": "parquet file parser for javascript",
|
||||
"keywords": [
|
||||
"parquet",
|
||||
|
||||
6
src/hyparquet.d.ts
vendored
6
src/hyparquet.d.ts
vendored
@ -117,8 +117,9 @@ export function toJson(obj: any): any
|
||||
/**
|
||||
* Construct an AsyncBuffer for a URL.
|
||||
* If byteLength is not provided, will make a HEAD request to get the file size.
|
||||
* If requestInit is provided, it will be passed to fetch.
|
||||
*/
|
||||
export function asyncBufferFromUrl(url: string, byteLength?: number): Promise<AsyncBuffer>
|
||||
export function asyncBufferFromUrl({url, byteLength, requestInit}: {url: string, byteLength?: number, requestInit?: RequestInit}): Promise<AsyncBuffer>
|
||||
|
||||
/**
|
||||
* Construct an AsyncBuffer for a local file using node fs package.
|
||||
@ -127,8 +128,9 @@ export function asyncBufferFromFile(filename: string): Promise<AsyncBuffer>
|
||||
|
||||
/**
|
||||
* Get the byte length of a URL using a HEAD request.
|
||||
* If requestInit is provided, it will be passed to fetch.
|
||||
*/
|
||||
export function byteLengthFromUrl(url: string): Promise<number>
|
||||
export function byteLengthFromUrl(url: string, requestInit?: RequestInit): Promise<number>
|
||||
|
||||
/**
|
||||
* Returns a cached layer on top of an AsyncBuffer.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user