@dsnp/parquetjs
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -6,3 +6,3 @@ { | ||
"types": "dist/parquet.d.ts", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"homepage": "https://github.com/LibertyDSNP/parquetjs", | ||
@@ -45,3 +45,3 @@ "license": "MIT", | ||
"core-js": "^3.22.5", | ||
"esbuild": "^0.14.38", | ||
"esbuild": "^0.14.47", | ||
"mocha": "10.0.0", | ||
@@ -67,2 +67,3 @@ "msw": "^0.39.2", | ||
"test": "mocha -r ts-node/register 'test/**/*.{js,ts}'", | ||
"test:only": "mocha -r ts-node/register", | ||
"clean": "rm -Rf ./dist", | ||
@@ -69,0 +70,0 @@ "prepublishOnly": "npm run clean && npm run build:node && npm run build:types && npm run build:browser", |
@@ -30,4 +30,4 @@ # parquet.js | ||
### NodeJS | ||
To use with nodejs: | ||
### NodeJS | ||
To use with nodejs: | ||
```javascript | ||
@@ -37,13 +37,43 @@ import parquetjs from "@dsnp/parquetjs" | ||
### Browser | ||
To use in a browser, in your bundler, depending on your needs, write the appropriate plugin or resolver to point to: | ||
### Browser with Bundler | ||
To use in a browser with a bundler, depending on your needs, write the appropriate plugin or resolver to point to either the Common JS or ES Module version: | ||
```javascript | ||
"node_modules/@dsnp/parquetjs/browser/parquetjs" | ||
// Common JS | ||
"node_modules/@dsnp/parquetjs/dist/browser/parquetjs.cjs" | ||
// ES Modules | ||
"node_modules/@dsnp/parquetjs/dist/browser/parquetjs.esm" | ||
``` | ||
or: | ||
```javascript | ||
import parquetjs from "@dsnp/parquetjs/browser/parquetjs" | ||
// Common JS | ||
import parquetjs from "@dsnp/parquetjs/dist/browser/parquetjs.cjs" | ||
// ES Modules | ||
import parquetjs from "@dsnp/parquetjs/dist/browser/parquetjs.esm" | ||
``` | ||
### Browser Direct: ES Modules | ||
To use directly in the browser without a bundler using ES Modules: | ||
1. Build the package: `npm install && npm run build:browser` | ||
2. Copy to `dist/browser/parquetjs.esm.js` the server | ||
3. Use it in your html or other ES Modules: | ||
```html | ||
<script type="module"> | ||
import parquetjs from '../parquet.esm.js'; | ||
// Use parquetjs | ||
</script> | ||
``` | ||
### Browser Direct: Plain Ol' JavaScript | ||
To use directly in the browser without a bundler or ES Modules: | ||
1. Build the package: `npm install && npm run build:browser` | ||
2. Copy to `dist/browser/parquetjs.js` the server | ||
2. Use the global `parquetjs` variable to access parquetjs functions | ||
```html | ||
<script> | ||
// console.log(parquetjs) | ||
</script> | ||
``` | ||
## Usage: Writing files | ||
@@ -79,3 +109,3 @@ | ||
take input rows as JSON objects, convert them to the Parquet format and store | ||
them on disk. | ||
them on disk. | ||
@@ -94,3 +124,3 @@ ``` js | ||
### Adding bloom filters | ||
### Adding bloom filters | ||
@@ -214,3 +244,3 @@ Bloom filters can be added to multiple columns as demonstrated below: | ||
Parquet files can be read from an S3 object without having to download the whole file. | ||
You will have to supply the aws-sdk client as first argument and the bucket/key information | ||
You will have to supply the aws-sdk client as first argument and the bucket/key information | ||
as second argument to the function `parquetReader.openS3`. | ||
@@ -299,3 +329,3 @@ | ||
Consider this example, which allows us to store a more advanced "fruits" table | ||
where each row contains a name, a list of colours and a list of "stock" objects. | ||
where each row contains a name, a list of colours and a list of "stock" objects. | ||
@@ -302,0 +332,0 @@ ``` js |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
2687285
51
18788
450