
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
bytemate-patch-web
Advanced tools
The JSON patching library that doesn't suck.
High-performance JSON patch library for Rust, Python, and JavaScript that actually works at scale.
Most JSON patch libraries were written when:
We fixed the entire category.
Based on real benchmarks, not marketing fluff:
| Operation | Time | Throughput | Status |
|---|---|---|---|
| Basic patch operations | 349ns | 2.9M ops/sec | ⚡ Sub-microsecond |
| Serial key operations | 12.6ms/1000 items | 79K ops/sec | 🎯 O(1) lookup |
| Large document patches | 1.2ms | 827K ops/sec | 📊 Linear scaling |
| JSON serialization | 1.3µs | - | 🚀 Microsecond-fast |
| Memory efficiency | Zero-copy | - | 💾 Zero-copy proven |
When you're patching 1000 objects:
🎯 Zero-Copy Operations We don't copy your data around like it's 1995. Your memory stays where it belongs.
⚡ Serial Key Magic List operations in O(1) time. Because O(n) is for people who hate their users.
🛡️ Type Safety That Actually Works Rust catches your mistakes at compile time, not in production at 3 AM.
🌐 Works Everywhere Python, Node.js, WebAssembly, browsers - if it runs code, we support it.
📋 Industry Standard Compatible Works with existing JSON patch workflows. No rewriting required.
🔒 Production Ready Memory safe, crash-free, tested by people who actually use it.
[dependencies]
bytemate-patch = "0.1"
use bytemate_patch::BytematePatch;
use serde_json::json;
// Basic patching
let data = json!({"name": "John", "age": 30});
let patch = BytematePatch::new()
.set("age", json!(31))
.set("city", json!("New York"));
let result = patch.apply(&data)?;
// {"name": "John", "age": 31, "city": "New York"}
// O(1) magic with serial keys
let users = json!([
{"_": "user1", "name": "Alice", "status": "active"},
{"_": "user2", "name": "Bob", "status": "inactive"}
]);
let patch = BytematePatch::new()
.set("user1", json!({"name": "Alice", "status": "premium"}))
.delete("user2");
let result = patch.apply(&users)?;
// [{"_": "user1", "name": "Alice", "status": "premium"}]
// Set and delete
BytematePatch::new()
.set("field", json!("value"))
.set("number", json!(42))
.delete("unwanted_field");
// Move and copy
BytematePatch::new()
.move_key("old_name", "new_name")
.copy_key("template", "instance");
// Test operations
BytematePatch::new()
.test("field", json!("expected_value"));
let mut data = json!({"large": "document"});
patch.apply_inplace(&mut data)?; // Modifies in place - no copying
let patch_json = json!({
"users": {
"user123": {"name": "New Name"},
"user456": {"*": null} // Delete syntax
}
});
let patch = BytematePatch::from_json(&patch_json)?;
let json_format = patch.to_json();
use bytemate_patch::{BytematePatch, BytemateError};
match patch.apply(&data) {
Ok(result) => println!("Success: {}", result),
Err(BytemateError::InvalidSerial(key)) => {
eprintln!("Serial key '{}' not found", key);
}
Err(BytemateError::TypeMismatch { expected, found }) => {
eprintln!("Expected {}, found {}", expected, found);
}
Err(e) => eprintln!("Error: {}", e),
}
pip install bytemate-patch
from bytemate_patch import BytematePatch
# Basic patching
data = {"name": "John", "age": 30}
patch = BytematePatch()
patch.set("age", 31)
patch.set("city", "New York")
result = patch.apply(data)
# {"name": "John", "age": 31, "city": "New York"}
# O(1) list operations
users = [
{"_": "user1", "name": "Alice", "status": "active"},
{"_": "user2", "name": "Bob", "status": "inactive"}
]
patch = BytematePatch()
patch.set("user1", {"name": "Alice", "status": "premium"})
patch.delete("user2")
result = patch.apply(users)
# [{"_": "user1", "name": "Alice", "status": "premium"}]
from bytemate_patch import BytematePatch
patch = BytematePatch()
# Supports all Python types
patch.set("string", "hello")
patch.set("number", 42)
patch.set("float", 3.14)
patch.set("boolean", True)
patch.set("none", None)
patch.set("list", [1, 2, 3])
patch.set("dict", {"nested": "value"})
# Length and boolean operations
len(patch) # Number of operations
bool(patch) # True if not empty
patch_json = {
"users": {
"user1": {"name": "Alice"},
"user2": {"*": None} # Delete syntax
}
}
patch = BytematePatch.from_json(patch_json)
# Convert back to JSON
json_format = patch.to_json()
base_patch = BytematePatch()
base_patch.set("a", 1)
override_patch = BytematePatch()
override_patch.set("b", 2)
merged = BytematePatch.merge(base_patch, override_patch)
try:
result = patch.apply(data)
except RuntimeError as e:
print(f"Patch error: {e}")
import bytemate_patch
print(bytemate_patch.__version__)
npm install bytemate-patch
import { JsBytematePatch } from 'bytemate-patch';
// Basic patching
const data = { name: "John", age: 30 };
const patch = new JsBytematePatch();
patch.set("age", 31);
patch.set("city", "New York");
const result = patch.apply(data);
// { name: "John", age: 31, city: "New York" }
// O(1) list operations
const users = [
{ _: "user1", name: "Alice", status: "active" },
{ _: "user2", name: "Bob", status: "inactive" }
];
const userPatch = new JsBytematePatch();
userPatch.set("user1", { name: "Alice", status: "premium" });
userPatch.delete("user2");
const result = userPatch.apply({ users });
// { users: [{ _: "user1", name: "Alice", status: "premium" }] }
import { JsBytematePatch, version } from 'bytemate-patch';
const patch = new JsBytematePatch();
// Supports all JS types
patch.set("string", "hello");
patch.set("number", 42);
patch.set("boolean", true);
patch.set("null", null);
patch.set("array", [1, 2, 3]);
patch.set("object", { nested: "value" });
// Properties
patch.length; // Number of operations
patch.isEmpty(); // True if empty
// Version
console.log(version());
const patchJson = {
users: {
user1: { name: "Alice" },
user2: { "*": null } // Delete syntax
}
};
const jsonPatch = JsBytematePatch.fromJson(patchJson);
// Convert back to JSON
const jsonFormat = jsonPatch.toJson();
const minorPatch = new JsBytematePatch();
minorPatch.set("a", 1);
const majorPatch = new JsBytematePatch();
majorPatch.set("b", 2);
const merged = JsBytematePatch.merge(minorPatch, majorPatch);
try {
const result = patch.apply(data);
} catch (error) {
console.error("Patch error:", error);
}
// Build patches incrementally for better performance
const patch = new JsBytematePatch();
for (const item of largeDataset) {
patch.set(item.key, item.value);
}
// Single apply call
const result = patch.apply(data);
<script type="module">
import { JsBytematePatch } from 'https://unpkg.com/bytemate-patch/pkg/bytemate_patch.js';
</script>
npm install bytemate-patch
<!DOCTYPE html>
<html>
<head>
<script type="module">
import init, { JsBytematePatch } from './pkg/bytemate_patch.js';
async function run() {
await init(); // Initialize WASM
const patch = new JsBytematePatch();
patch.set("browser", "support");
const result = patch.apply({ data: "original" });
console.log(result);
}
run();
</script>
</head>
</html>
// Works with Webpack, Vite, Rollup, etc.
import { JsBytematePatch } from 'bytemate-patch';
const patch = new JsBytematePatch();
patch.set("bundler", "compatible");
// TypeScript support included
// Automatic .d.ts generation
Rust:
BytematePatch::new()
.set("field", json!("value"))
.delete("unwanted_field");
Python:
patch = BytematePatch()
patch.set("field", "value")
patch.delete("unwanted_field")
JavaScript:
const patch = new JsBytematePatch();
patch.set("field", "value");
patch.delete("unwanted_field");
The secret sauce that makes list operations O(1):
// Instead of searching through arrays...
let data = json!([
{"_": "abc123", "name": "User 1"},
{"_": "def456", "name": "User 2"}
]);
// Direct access by serial key
let patch = BytematePatch::new()
.set("abc123", json!({"name": "Updated User 1"}));
{
"users": {
"user123": {"name": "New Name"},
"user456": {"*": null}
}
}
// Rust
let patch = BytematePatch::from_json(&patch_json)?;
# Python
patch = BytematePatch.from_json(patch_json)
// JavaScript
const patch = JsBytematePatch.fromJson(patchJson);
All Languages Support Merging:
// Rust
let merged = BytematePatch::merge(base_patch, override_patch);
# Python
merged = BytematePatch.merge(base_patch, override_patch)
// JavaScript
const merged = JsBytematePatch.merge(basePatch, overridePatch);
Each language provides appropriate error handling mechanisms:
Result<T, BytemateError> with detailed error typesRuntimeError exceptions with descriptive messagesapply_inplace() for zero-copy operationsOld way (JSON Patch):
[
{"op": "replace", "path": "/name", "value": "New Name"},
{"op": "remove", "path": "/age"}
]
New way (BYTEMATE:PATCH):
let patch = BytematePatch::new()
.set("name", json!("New Name"))
.delete("age");
BYTEMATE:PATCH uses an intuitive builder pattern that's easier to read and write across all languages.
| Platform | Status | Package | Installation |
|---|---|---|---|
| Rust | ✅ Native | bytemate-patch | cargo add bytemate-patch |
| Python 3.8+ | ✅ Wheels | bytemate-patch | pip install bytemate-patch |
| Node.js 16+ | ✅ WASM | bytemate-patch | npm install bytemate-patch |
| Browsers | ✅ WASM | ES modules | CDN or bundler |
| TypeScript | ✅ Included | Auto-generated | .d.ts included |
Other libraries use warnings instead of proper error handling. They rebuild indexes on every operation. They make you choose between "fast" and "works correctly."
We said "why not both?" and built it in Rust.
Your users deserve better than waiting 200ms for a simple patch operation.
So do you.
All benchmarks run on real hardware, measuring real operations:
MIT License - because we're not monsters.
Found a bug? Performance issue? We actually want to hear about it.
Open an issue or PR on GitHub.
Built with ❤️ and an unhealthy obsession with performance.
FAQs
High-performance JSON patch library for Javascript, Rust, and Python
We found that bytemate-patch-web 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.