npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bai2-parser

v1.0.8

Published

Parse the bai2 statement file as CSV or JSON file

Downloads

3

Readme

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

  1. 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

| Key | Default | Description | | -------- | --------------- | ------------------------------------------------ | | output | 'JSON' | 'CSV' | You can use this option to customize the output. |

📄 License

MIT