Gathering detailed insights and metrics for @skgdev/socket.io-msgpack-javascript
Gathering detailed insights and metrics for @skgdev/socket.io-msgpack-javascript
Gathering detailed insights and metrics for @skgdev/socket.io-msgpack-javascript
Gathering detailed insights and metrics for @skgdev/socket.io-msgpack-javascript
npm install @skgdev/socket.io-msgpack-javascript
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
19 Stars
57 Commits
3 Forks
2 Watching
3 Branches
3 Contributors
Updated on 21 Oct 2024
TypeScript (100%)
Cumulative downloads
Total Downloads
Last day
29.2%
31
Compared to previous day
Last week
-19.1%
203
Compared to previous week
Last month
-26%
875
Compared to previous month
Last year
1.7%
11,805
Compared to previous year
An alternative to the default socket.io-parser, encoding and decoding packets with msgpack official latest javascript version msgpack-javascript
Please note that you MUST use the parser on both sides (server & client).
Compatibility table:
Parser version | Socket.IO server version |
---|---|
1.x.x | 3.x.x / 4.x.x |
npm i -S skgdev/socket.io-msgpack-javascript
This package doesn't has separate typing to be install, usage is the same regardless of TypeScript or normal JavaScript
EncodeOptions
Name | Type | Default |
---|---|---|
maxDepth | number | 100 |
initialBufferSize | number | 2048 |
sortKeys | boolean | false |
forceFloat32 | boolean | false |
forceIntegerToFloat | boolean | false |
ignoreUndefined | boolean | false |
See:
DecodeOptions
Name | Type | Default |
---|---|---|
maxStrLength | number | 4_294_967_295 (UINT32_MAX) |
maxBinLength | number | 4_294_967_295 (UINT32_MAX) |
maxArrayLength | number | 4_294_967_295 (UINT32_MAX) |
maxMapLength | number | 4_294_967_295 (UINT32_MAX) |
maxExtLength | number | 4_294_967_295 (UINT32_MAX) |
You can use max${Type}Length
to limit the length of each type decoded.
See:
1import customParser from '@skgdev/socket.io-msgpack-javascript';
1const customParser = require('@skgdev/socket.io-msgpack-javascript');
1import { Server } from 'socket.io'; 2import { io } from "socket.io-client"; 3import customParser from '@skgdev/socket.io-msgpack-javascript'; 4 5// Server 6const server = new Server(PORT, { 7 parser: customParser.build({ 8 encoder: ?EncodeOptions, 9 decoder: ?DecodeOptions 10 }) 11}); 12 13// Client 14const socket = io('https://server-domain.com', { 15 parser: customParser.build({ 16 encoder: ?EncodeOptions, 17 decoder: ?DecodeOptions 18 }) 19});
socket.emit('hello', 'you')
will create the following packet:
1{ 2 "type": 2, 3 "nsp": "/", 4 "data": ["hello", "you"] 5}
which will be encoded by the parser as:
<Buffer 83 a4 74 79 70 65 02 a3 6e 73 70 a1 2f a4 64 61 74 61 92 a5 68 65 6c 6c 6f a3 79 6f 75>
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 6/9 approved changesets -- score normalized to 6
Reason
5 existing vulnerabilities detected
Details
Reason
1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More