# breakpoint-data-handler

> loads and exports breakpoint model data

Latest version **0.14.0** (published 2022-03-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install breakpoint-data-handler
pnpm add breakpoint-data-handler
yarn add breakpoint-data-handler
bun add breakpoint-data-handler
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.14.0 |
| Published | 2022-03-07 |
| First published | 2021-05-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14 |
| Dependencies | 7 |
| Unpacked size | 226.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | jogitt |
| Maintainers | npmjoes |
| Keywords | breakpoint |

## Links

- npm: https://www.npmjs.com/package/breakpoint-data-handler
- npm.io page: https://npm.io/package/breakpoint-data-handler

## Dependencies (7)

- [jest](https://npm.io/package/jest.md) ^26.6.3
- [dotenv](https://npm.io/package/dotenv.md) ^10.0.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [commander](https://npm.io/package/commander.md) ^7.2.0
- [@types/lodash](https://npm.io/package/@types/lodash.md) ^4.14.170
- [builtin-modules](https://npm.io/package/builtin-modules.md) ^3.2.0
- [rollup-plugin-node-externals](https://npm.io/package/rollup-plugin-node-externals.md) ^2.2.0

## Recent versions

- 0.14.0 (latest) — 2022-03-07
- 0.13.0 — 2021-12-20
- 0.12.2 — 2021-12-08
- 0.12.1 — 2021-12-08
- 0.12.0 — 2021-12-06
- 0.11.0 — 2021-12-06
- 0.10.0 — 2021-12-02
- 0.9.0 — 2021-06-10
- 0.8.2 — 2021-06-03
- 0.8.1 — 2021-05-30
- 0.8.0 — 2021-05-30
- 0.7.0 — 2021-05-28
- 0.6.1 — 2021-05-27
- 0.6.0 — 2021-05-27
- 0.5.0 — 2021-05-27
- … 6 more at https://npm.io/package/breakpoint-data-handler/versions

## README

# BreakpointDataHandler
## @jogitt
## last updated: 2021-12-01

This package houses functions for reading, writing, and memory storing breakpoint data.

## Usage
- you first need to set a BreakpointDataHandlerGlobals object:
```typescript
import {BreakpointDataHandlerGlobalsBuilder} from 'breakpointdatahandler';
const projectGlobals = new BreakpointDataHandlerGlobalsBuilder().setType(FileType.DEPARTMENT).setInPath(process.env.DEPT_DATA_CSV as string).setOutPath("out").build();
```
- then, set if you want *DepartmentFileHandler*, *VendorFileHandler*, or *ProductFileHandler*:
```typescript
import {DepartmentFileHandler} from 'breakpointdatahandler';
const deptFileHandler = new DepartmentFileHandler(projectGlobals);
```

- to read breakpoint data to memory:
```typescript
import {IDepartment} from 'breakpointdatahandler';
const response:IDepartment[] = await deptFileHandler.read();
```

- to write data to disc:
```typescript
const response = await deptFileHandler.write(data, outPath)
```
- for products, you can also read json format into memory
```typescript
const productJsonFileHandler = new ProductFileHandler(testGlobals);
const response: IProduct[] = await productJsonFileHandler.readJsonFile();
```

- update 0.9.0, can do readJson for vendor or departments now as well:
```typescript
const departmentFileHandler = new DepartmentFileHandler(testGlobals);
const response: IDepartment[] = await departmentFileHandler.readJsonFile();
```

---
_Source: https://npm.io/package/breakpoint-data-handler · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
