https://github.com/techmdw/sie-parser
Parse sie files to JS object
https://github.com/techmdw/sie-parser
Last synced: 11 months ago
JSON representation
Parse sie files to JS object
- Host: GitHub
- URL: https://github.com/techmdw/sie-parser
- Owner: TechMDW
- Created: 2021-11-16T02:54:59.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-16T02:55:06.000Z (over 4 years ago)
- Last Synced: 2025-07-11T02:21:42.149Z (11 months ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# sie-parser (WIP)
Parses sie files to JavaScript Object. This is still a WIP but I'll try to push updates when I got time.
Tried to keep the project in english but the variable names from the sie are in swedish as they are presented. This will be fixed onces I add support for sie5.
# Installation
`npm i sie-parser`
# Usage
Initialize the parser
```ts
import sieParser from 'sie-parser';
const sie = new sieParser('./myfile2parse.se');
```
# Functions
Get full parsed content
```ts
const sieObject = sie.sieObject;
```
Get verifications
```ts
// This will return array with all existing verifications
const verifications = sie.getVerifications()
/*
* Returns data as array on all verification with that series
* Exapmle of series A, B, C, D
*/
const verificationsSpecific = sie.getVerificationsData(series:string)
```
Get Accounts
```ts
// Returns array with all accounts with objects including { kontonr, kontonamn }
const accounts = sie.getAccount();
/*
Example output
[
{
kontonr: '1010',
kontonamn: 'Utvecklingsutgifter'
},
{
kontonr: '1011',
kontonamn: 'Balanserade utgifter för forskning och utveckling'
}
]
*/
// if you wanna get more specific data your can use
const kontonr = '1010' || 1010;
// Options will filter the response data
const opts = {
ib: false || true,
ub: false || true,
psaldo: false || true,
konto: false || true,
};
// All options are optional if not manually set they default to false
const account = sie.getAccount(kontonr, opts);
/*
Example output
{
kontonr: '1012',
kontonamn: 'Balanserade utgifter för programvaror',
IB: [],
UB: [],
PSALDO: []
}
*/
```
# Report issues
Please report all issues [here](https://github.com/techmdw/sie-parser/issues)!