Skip to main content
Home

Built and signed on GitHub Actions

RESPv2/3 Parser

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
a year ago (6.0.4)

resp3-parser

Parser for RESP protocol v2/v3

Basic Example

const parser = new Resp3Parser()

const blob = new TextEncoder().encode('+This is a test...\r\n#t\r\n:1234567890\r\n')
parser.appendChunk(blob.subarray(0,9))
parser.appendChunk(blob.subarray(9))

while (parser.remainingBytes > 0) {
    console.log(parser.process())
}

// Outputs:
// This is a test...
// true
// 1234567890

RESP3 Features

Feature Supported
Attributes Yes
Streamed strings Yes
Streamed aggregated data types Yes
Sets Yes
Maps Yes
Verbatim Strings Yes
Blob Errors Yes
Pushes Yes
Big Numbers Yes
Booleans Yes
Doubles Yes
Null Yes
Hello Yes

Types

RESP Javascript
Simple String string
Simple Error Failure
Integer number or bigint
Big Number bigint
Boolean boolean
Double number
Array Array
Null null
Bulk String Bulk or string
Verbatim String FormatedBulk
Bulk Error Failure
Set Unordered
Map Hash
Attributes Hash
Hello Hash
Push Push
Reply with Attributes { reply: unknown, attributes: Hash }
Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@geacko/resp3-parser

Import symbol

import * as resp__parser from "@geacko/resp3-parser";
or

Import directly with a jsr specifier

import * as resp__parser from "jsr:@geacko/resp3-parser";

Add Package

pnpm i jsr:@geacko/resp3-parser
or (using pnpm 10.8 or older)
pnpm dlx jsr add @geacko/resp3-parser

Import symbol

import * as resp__parser from "@geacko/resp3-parser";

Add Package

yarn add jsr:@geacko/resp3-parser
or (using Yarn 4.8 or older)
yarn dlx jsr add @geacko/resp3-parser

Import symbol

import * as resp__parser from "@geacko/resp3-parser";

Add Package

npx jsr add @geacko/resp3-parser

Import symbol

import * as resp__parser from "@geacko/resp3-parser";

Add Package

bunx jsr add @geacko/resp3-parser

Import symbol

import * as resp__parser from "@geacko/resp3-parser";