New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

json-column-parser

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-column-parser

JSON parser for several big data sources formatted columns

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

npm npm GitHub npm bundle size

json-column-parser

A JSON parser for several big data sources formatted columns.

This package provides the required functionality to process the type of a complex column to a convenient json representation.

Nested Hive Column Example

array<struct<student:struct<name:string,id:string,subjects:array<struct<sub_name:string,sub_id:bigint>>>,supply:struct<
amount:bigint,product:struct<product_id:string,product_name:string,template:struct<code:string,currency:string>>,color:string>>>

Quick Start

Installation

Install this component with NPM.

npm install --save json-column-parser

Implementation

import { parser, types } from "json-column-parser";

// Parse one or more columns
// The nestedColumn used is the one from the example 	above
const parsed = parser.parseColumns([
  { name: "test_column", type: nestedColumn, description: "test_description" },
]);

console.dir(parsed[0].colType);
console.dir((parsed[0].colType as types.JSONArray)[0]);

Output

[
  {
    student: { name: 'string', id: 'string', subjects: [Array] },
    supply: { amount: 'bigint', product: [Object], color: 'string' }
  }
]
{
  student: { name: 'string', id: 'string', subjects: [ [Object] ] },
  supply: {
    amount: 'bigint',
    product: {
      product_id: 'string',
      product_name: 'string',
      template: [Object]
    },
    color: 'string'
  }
}

Keywords

JSON

FAQs

Package last updated on 04 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts