# saz2js

> A utility which consumes a saz file and converts to a sessions object

Latest version **1.0.2** (published 2019-08-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install saz2js
pnpm add saz2js
yarn add saz2js
bun add saz2js
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-08-09 |
| First published | 2019-06-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 8.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | dnafication |
| Maintainers | dnafication |
| Keywords | saz, parse, json |

## Links

- npm: https://www.npmjs.com/package/saz2js
- Homepage: https://github.com/dnafication/saz2js
- npm.io page: https://npm.io/package/saz2js

## Dependencies (3)

- [yauzl](https://npm.io/package/yauzl.md) ^2.10.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [xml-js](https://npm.io/package/xml-js.md) ^1.6.11

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.2 (latest) — 2019-08-09
- 1.0.1 — 2019-06-14
- 1.0.0 — 2019-06-14
- 0.0.2 — 2019-06-05
- 0.0.1 — 2019-06-05

## README

# saz2js

A utility to convert fiddler capture (`.saz`) to js object.

The code is inspired by [node-saz-parser](https://github.com/ludoviclefevre/node-saz-parser), updated to use [yauzl](https://github.com/thejoshwolfe/yauzl) instead of `unzip`.

**Breaking Change:** The release 1.0.0 and above allows you to control the content of sessions object, hence the api change. Now it parses the meta data as well.

## Usage

1. install the package `npm i saz2js`
2. sample node script

```javascript
const parser = require('saz2js');

const options = {
  req: true, // determines if the sessions object will contain request data
  res: true, // determines if the sessions object will contain response data
  meta: true // determines if the sessions object will contain meta information
}

parser('test.saz', options, function(err, sessions) {
  if (err) throw err;
  console.log(sessions);
});

// sessions object
{
  '09': {
    request: {
      method: 'GET',
      url: 'https://example.com?refresh=Refresh&url=true',
      protocol: 'HTTP/1.1',
      headers: {
        'Accepted': ''
        ...
      },
      content: 'body of request'
    },
    response: {
      protocol: 'HTTP/1.1',
      statusCode: '200',
      status: 'OK',
      headers: {
        ...
      },
      content: 'body of response'
    },
    meta: {
      _declaration: {
        _attributes: {
          version: "1.0",
          encoding: "utf-8"
        }
      },
      Session: {
        _attributes: {
          SID: "167",
          BitFlags: "19"
        },
      SessionTimers: {
          _attributes: {
            ClientConnected: "2019-06-07T11:24:55.8156275+10:00",
            ...
          }
        },
      PipeInfo: {
          _attributes: {
            CltReuse: "true",
            Reused: "true"
          }
        },
      SessionFlags: {
        SessionFlag: [
            {
              _attributes: {
                N: "x-processinfo",
                V: "chrome:6152"
              }
            },
            ...
          ]
        }
      }
    }
  }
  }
  ...
};

```

That's it, really!

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