🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

bai2-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

bai2-parser

Parse the bai2 statement file as CSV or JSON file

1.0.8
latest
npm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

BAI2 Parser

BAI2 Parser is for parsing the bai(Bank Administration Institute) files and convert into the CSV or JSON file. Check out our documentation below to learn how to get started

Contents

  • Installation
  • Usage
  • Methods

🚀 Installation

  • Install bai2-parser:
npm install bai2-parser
yarn add bai2-parser

🎉 Usage

Here is a basic example of how to use bai2 parser. By using this, you can read the input directly from file or pass the string.

  • Example with pass the string
import fs from 'fs'
import { BAI2 } from 'bai2-parser'

const fileString = fs.readFileSync(`./sample.bai`).toString()

// You can get the parsed answer from file string using below prop.

const parsefromString = BAI2.fromString(fileString, { output:'JSON' })

console.log('parsefromString', parsefromString)

  • Example with pass the file directly
import { BAI2 } from 'bai2-parser'

// You can get the parsed answer from file using below prop.

const parsefromFile = BAI2.fromFile(`./sample.bai`, { output:'CSV' })

console.log('parsefromFile', parsefromFile)

📖 Methods

BAI2.fromString(fileString, options) => string | object | Error

Returns the JSON or CSV string or rejects with an Error if there was an issue.

  • fileString - An fileString of BAI2 file to be converted to JSON or CSV.
  • options - (Optional) A BAI2 file specifying any of the following key value pairs:

BAI2.fromFile(filePath, options) => string | object | Error

Returns the JSON or CSV string or rejects with an Error if there was an issue.

  • filePath - An filePath of BAI2 file to be converted to JSON or CSV.
  • options - (Optional) A BAI2 file specifying any of the following key value pairs:

Options

KeyDefaultDescription
output'JSON' | 'CSV'You can use this option to customize the output.

📄 License

MIT

Keywords

bai2

FAQs

Package last updated on 08 Dec 2023

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