Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pocesar/node-packet-frame
Easy streaming packet framing and serialization
https://github.com/pocesar/node-packet-frame
Last synced: 17 days ago
JSON representation
Easy streaming packet framing and serialization
- Host: GitHub
- URL: https://github.com/pocesar/node-packet-frame
- Owner: pocesar
- License: mit
- Created: 2014-02-28T05:11:36.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-24T01:41:12.000Z (almost 9 years ago)
- Last Synced: 2024-10-18T06:28:25.279Z (27 days ago)
- Language: JavaScript
- Homepage:
- Size: 51.8 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/pocesar/node-packet-frame.png?branch=master)](https://travis-ci.org/pocesar/node-packet-frame)
[![Coverage Status](https://coveralls.io/repos/pocesar/node-packet-frame/badge.svg?branch=master&service=github)](https://coveralls.io/github/pocesar/node-packet-frame?branch=master)
[![Dependency Status](https://david-dm.org/pocesar/node-packet-frame.svg?theme=shields.io)](https://david-dm.org/pocesar/node-packet-frame)[![NPM](https://nodei.co/npm/packet-frame.png?downloads=true&stars=true)](https://nodei.co/npm/packet-frame/)
Packet Frame
===========Easy streaming packet framing and serialization.
# Install
```bash
npm install packet-frame
```# What?
Framing a packet means wrapping the payload with a header and checksums to ensure they are valid, and having it's size set.
The frames are limited to 65k (uint16), a "magic" version is added, along with CRC32 to the header and to the payload, recursively.
You can choose to drop invalid payloads, or deal with it manually.
# How?
```es6
import { Parser } from 'packet-frame'var stream = Parser.createStream({
policy: 'drop' // default
})net.createServer((socket) => {
socket.pipe(stream).pipe(socket); // only the valid data is echoed back
})
```# License
MIT