# @sleep-client/parser

> Rest file parser

Latest version **0.1.0** (published 2020-01-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sleep-client/parser
pnpm add @sleep-client/parser
yarn add @sleep-client/parser
bun add @sleep-client/parser
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2020-01-18 |
| First published | 2020-01-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kylee Tilley |
| Maintainers | kyleect |

## Links

- npm: https://www.npmjs.com/package/@sleep-client/parser
- Repository: https://github.com/testingrequired/sleep-client
- Homepage: https://github.com/testingrequired/sleep-client#readme
- Issues: https://github.com/testingrequired/sleep-client/issues
- npm.io page: https://npm.io/package/@sleep-client/parser

## Recent versions

- 0.1.0 (latest) — 2020-01-18

## README

# @sleep-client/parser

Library for parsing sleep client state files.

## Installation

```bash
$ npm i @sleep-client/parser
```

## Usage

```javascript
import {
  parse,
  ParsedStateFile,
  mapParsedToExport
} from "@sleep-client/parser";

(await () => {
  try {
    const parsedStateFile: ParsedStateFile = await parse("./path/to/stateFile");

    const workspaces = parsedStateFile.getWorkspaces();
    const collections = parsedStateFile.getWorkspaceCollections(workspaces[0]);
    const requests = parsedStateFile.getCollectionRequests(collections[0]);

    const stateFileJson = JSON.stringify(mapParsedToExport(parsedStateFile));
  } catch(e){
    e.message // Contains any errors parsing
  }
})()
```

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