Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hyparquet

Package Overview
Dependencies
Maintainers
0
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyparquet - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

src/query.js

29

package.json
{
"name": "hyparquet",
"version": "1.3.0",
"version": "1.4.0",
"description": "parquet file parser for javascript",

@@ -25,2 +25,3 @@ "keywords": [

"demo": "http-server -o",
"demo:build": "rollup -c",
"lint": "eslint .",

@@ -30,13 +31,23 @@ "test": "vitest run"

"devDependencies": {
"@types/node": "22.4.1",
"@typescript-eslint/eslint-plugin": "8.2.0",
"@vitest/coverage-v8": "2.0.5",
"eslint": "8.57.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsdoc": "50.2.2",
"@rollup/plugin-commonjs": "28.0.0",
"@rollup/plugin-node-resolve": "15.3.0",
"@rollup/plugin-replace": "6.0.1",
"@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-typescript": "12.1.0",
"@types/node": "22.7.0",
"@types/react": "18.3.9",
"@types/react-dom": "18.3.0",
"@vitest/coverage-v8": "2.1.1",
"eslint": "9.11.1",
"eslint-plugin-jsdoc": "50.2.4",
"hightable": "0.4.4",
"http-server": "14.1.1",
"hyparquet-compressors": "0.1.4",
"typescript": "5.5.4",
"vitest": "2.0.5"
"react": "18.3.1",
"react-dom": "18.3.1",
"rollup": "4.22.4",
"typescript": "5.6.2",
"typescript-eslint": "8.7.0",
"vitest": "2.1.1"
}
}

@@ -9,3 +9,3 @@ # hyparquet

[![dependencies](https://img.shields.io/badge/Dependencies-0-blueviolet)](https://www.npmjs.com/package/hyparquet?activeTab=dependencies)
![coverage](https://img.shields.io/badge/Coverage-95-darkred)
![coverage](https://img.shields.io/badge/Coverage-96-darkred)

@@ -18,3 +18,3 @@ Dependency free since 2023!

Hyparquet allows you to read and extract data from Parquet files directly in JavaScript environments, both in Node.js and in the browser. It is designed to be fast, memory-efficient, and easy to use.
Hyparquet allows you to read and extract data from Parquet files directly in JavaScript environments, both in Node.js and in the browser, without any dependencies. Designed for performance and ease of use, hyparquet is ideal for data engineering, data science, and machine learning applications that require efficient data processing.

@@ -27,2 +27,4 @@ ## Demo

[![hyparquet demo](demo/assets/demo.png)](https://hyparam.github.io/hyparquet/)
## Features

@@ -57,3 +59,3 @@

```js
```javascript
const { asyncBufferFromFile, parquetRead } = await import('hyparquet')

@@ -83,3 +85,3 @@ await parquetRead({

```js
```javascript
const { parquetMetadata } = await import('hyparquet')

@@ -97,3 +99,3 @@ const fs = await import('fs')

```js
```javascript
import { parquetMetadata } from 'hyparquet'

@@ -115,3 +117,3 @@

```js
```javascript
import { parquetRead } from 'hyparquet'

@@ -133,3 +135,3 @@

```js
```javascript
import { parquetRead } from 'hyparquet'

@@ -160,3 +162,3 @@

```js
```javascript
import { parquetRead } from 'hyparquet'

@@ -163,0 +165,0 @@

@@ -45,2 +45,13 @@ import type { AsyncBuffer, Compressors, FileMetaData, SchemaTree } from './types.d.ts'

/**
* Wraps parquetRead with orderBy support.
* This is a parquet-aware query engine that can read a subset of rows and columns.
* Accepts an optional orderBy column name to sort the results.
* Note that using orderBy may SIGNIFICANTLY increase the query time.
*
* @param {ParquetReadOptions & { orderBy?: string }} options
* @returns {Promise<Record<string, any>[]>} resolves when all requested rows and columns are parsed
*/
export function parquetQuery(options: ParquetReadOptions & { orderBy?: string }): Promise<Array<Record<string, any>>>
/**
* Read parquet metadata from an async buffer.

@@ -47,0 +58,0 @@ *

@@ -1,3 +0,2 @@

import { parquetMetadata, parquetMetadataAsync, parquetSchema } from './metadata.js'
export { parquetMetadata, parquetMetadataAsync, parquetSchema }
export { parquetMetadata, parquetMetadataAsync, parquetSchema } from './metadata.js'

@@ -7,8 +6,8 @@ import { parquetRead } from './read.js'

import { snappyUncompress } from './snappy.js'
export { snappyUncompress }
export { parquetQuery } from './query.js'
import { asyncBufferFromFile, asyncBufferFromUrl, toJson } from './utils.js'
export { asyncBufferFromFile, asyncBufferFromUrl, toJson }
export { snappyUncompress } from './snappy.js'
export { asyncBufferFromFile, asyncBufferFromUrl, toJson } from './utils.js'
/**

@@ -15,0 +14,0 @@ * @param {import('./hyparquet.js').ParquetReadOptions} options

@@ -40,11 +40,9 @@ /**

/**
* Construct an AsyncBuffer for a URL.
* Get the byte length of a URL using a HEAD request.
*
* @typedef {import('./types.js').AsyncBuffer} AsyncBuffer
* @param {string} url
* @returns {Promise<AsyncBuffer>}
* @returns {Promise<number>}
*/
export async function asyncBufferFromUrl(url) {
// byte length from HEAD request
const byteLength = await fetch(url, { method: 'HEAD' })
export async function byteLengthFromUrl(url) {
return await fetch(url, { method: 'HEAD' })
.then(res => {

@@ -56,2 +54,15 @@ if (!res.ok) throw new Error(`fetch head failed ${res.status}`)

})
}
/**
* Construct an AsyncBuffer for a URL.
*
* @typedef {import('./types.js').AsyncBuffer} AsyncBuffer
* @param {string} url
* @param {number} [byteLength]
* @returns {Promise<AsyncBuffer>}
*/
export async function asyncBufferFromUrl(url, byteLength) {
// byte length from HEAD request
byteLength ||= await byteLengthFromUrl(url)
return {

@@ -58,0 +69,0 @@ byteLength,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc