-
-
Notifications
You must be signed in to change notification settings - Fork 1
Improve documentation with centralized docs/ folder and enhanced README #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d27fb1c
Initial plan
Copilot 9014e59
Initial documentation improvement plan
Copilot 4a6b67f
Create docs/ folder with comprehensive codec documentation
Copilot 20da1b8
Include docs/ folder in npm package and finalize documentation
Copilot ff9a2de
Address PR feedback: revert yarn.lock, remove package-lock.json, move…
Copilot b4269a7
Update CBOR documentation with comprehensive guide and examples
Copilot 8bb0b9b
Remove docs/ folder and move codec documentation to src/<codec>/READM…
Copilot 0753284
Merge branch 'master' into copilot/fix-13
Copilot 352b7c1
Resolve merge conflicts and add back detailed benchmarks to main README
Copilot 2e59483
docs: ✏️ update benchmarks in README
streamich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,61 @@ | ||
# RESP v2 and RESP3 codecs | ||
|
||
Redis Serialization Protocol (RESP) implementation supporting both RESP2 and RESP3 formats. | ||
|
||
## Overview | ||
|
||
RESP is the protocol used by Redis to communicate between clients and servers. This implementation provides: | ||
|
||
- **RESP3** encoder (`RespEncoder`) - Full support for all RESP3 data types | ||
- **RESP2** encoder (`RespEncoderLegacy`) - Legacy RESP2 support | ||
- **RESP decoder** (`RespDecoder`) - Decodes both RESP2 and RESP3 formats | ||
- **Streaming decoder** (`RespStreamingDecoder`) - For parsing streaming RESP data | ||
|
||
## Supported Data Types | ||
|
||
### RESP3 Types | ||
- Simple strings | ||
- Simple errors | ||
- Integers | ||
- Bulk strings | ||
- Arrays | ||
- Nulls | ||
- Booleans | ||
- Doubles | ||
- Maps | ||
- Sets | ||
- Attributes | ||
- Push messages | ||
- Verbatim strings | ||
|
||
### RESP2 Types | ||
- Simple strings | ||
- Errors | ||
- Integers | ||
- Bulk strings | ||
- Arrays | ||
|
||
## Usage | ||
|
||
```ts | ||
import {RespEncoder, RespDecoder} from 'json-pack/lib/resp'; | ||
|
||
const encoder = new RespEncoder(); | ||
const decoder = new RespDecoder(); | ||
|
||
// Encode data | ||
const data = {hello: 'world', count: 42}; | ||
const encoded = encoder.encode(data); | ||
|
||
// Decode data | ||
const decoded = decoder.decode(encoded); | ||
console.log(decoded); // {hello: 'world', count: 42} | ||
``` | ||
|
||
## Extensions | ||
|
||
The RESP implementation supports Redis-specific extensions: | ||
|
||
- **RespAttributes** - For attribute metadata | ||
- **RespPush** - For push messages | ||
- **RespVerbatimString** - For verbatim strings with format info |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/
. Link to it from main readme.json-pack
library is the fastest library in NPM ecosystem.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved benchmarks section to docs/benchmarks.md and added link to the benchmarking blog post in commit ff9a2de.