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

1.6.0 • Public • Published

@htptp/hurl-parser

The Hurl file parser, compiled to WASM and callable from JavaScript!

Usage

import { parse } from "@htptp/hurl-parser";

const result = parse(`
  GET http://example.com
  HTTP/* 200
`);

The returned data will be as follows

{
  "entries": [
    {
      "request": {
        "method": "GET",
        "url": "http://example.com"
      },
      "response": {
        "status": 200
      }
    }
  ]
}

The module also exports TypeScript types for these structures.

import type { Hurl } from "@htptp/hurl-parser";

const result: Hurl.Document = parse(/* ... */);

Installation

Just install to your dependencies

$ yarn add @htptp/hurl-parser    # if you use yarn
$ npm install @htptp/hurl-parser # if you use npm

And import normally

Limitations

Readme

Keywords

Package Sidebar

Install

npm i @htptp/hurl-parser

Weekly Downloads

1

Version

1.6.0

License

ISC

Unpacked Size

914 kB

Total Files

5

Last publish

Collaborators

  • cprecioso