@sleep-client/parser
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

@sleep-client/parser

Library for parsing sleep client state files.

Installation

$ npm i @sleep-client/parser

Usage

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
  }
})()

Readme

Keywords

none

Package Sidebar

Install

npm i @sleep-client/parser

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

14 kB

Total Files

48

Last publish

Collaborators

  • kyleect