
Security News
High Salaries No Longer Enough to Attract Top Cybersecurity Talent
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
turbo-stream
Advanced tools
A streaming data transport format that aims to support built-in features such as Promises, Dates, RegExps, Maps, Sets and more.
A streaming data transport format that aims to support built-in features such as Promises, Dates, RegExps, Maps, Sets and more.
npm install turbo-stream
import { decode, encode } from "turbo-stream";
const encodedStream = encode(Promise.resolve(42));
const decoded = await decode(encodedStream);
console.log(decoded); // 42
Run them yourself with pnpm bench
• realistic payload
------------------------------------------- -------------------------------
JSON 2.80 µs/iter 2.71 µs █▆
(2.59 µs … 5.61 µs) 5.55 µs ██
( 2.91 kb … 2.91 kb) 2.91 kb ██▁▂▁▁▁▁▁▂▁▁▁▁▁▁▁▁▁▁▂
turbo encode 16.71 µs/iter 16.47 µs █
(16.04 µs … 19.47 µs) 18.38 µs ███
( 2.80 kb … 2.81 kb) 2.80 kb ██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█
turbo full 35.30 µs/iter 36.33 µs █
(31.38 µs … 202.79 µs) 52.50 µs █▃ ▄
( 2.47 kb … 454.32 kb) 104.44 kb ▂██▃▅█▂▂▂▂▁▁▁▁▁▁▁▁▁▁▁
┌ ┐
┬ ╷
JSON │──┤
┴ ╵
┌┬╷
turbo encode ││┤
└┴╵
╷┌─┬┐ ╷
turbo full ├┤ │├──────────────┤
╵└─┴┘ ╵
└ ┘
2.59 µs 27.55 µs 52.50 µs
summary
turbo encode
5.97x slower than JSON
2.11x faster than turbo full
Shout out to Rich Harris and his https://github.com/rich-harris/devalue project. Devalue has heavily influenced this project and portions of the original code was directly lifted from it. I highly recommend checking it out if you need something more cusomizable or without streaming support. This new version has been re-written from the ground up and no longer resembles devalue.
FAQs
A streaming data transport format that aims to support built-in features such as Promises, Dates, RegExps, Maps, Sets and more.
The npm package turbo-stream receives a total of 1,917,487 weekly downloads. As such, turbo-stream popularity was classified as popular.
We found that turbo-stream demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.