Security News
UK Officials Consider Banning Ransomware Payments from Public Entities
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
json-escaping
Advanced tools
Fast JSON string escaping in JS.
It is faster to escape small JSON strings manually than using native
JSON.stringify()
.
The main focus is a very fast check for strings that do not need any escaping while also improving escaping itself or at least not to go below JSON.stringify.
Running the benchmarks (npm run benchmark
) show the benefits:
node ./benchmark
JSON short non escaped x 2,884,878 ops/sec ±2.25% (95 runs sampled)
this short non escaped x 13,082,026 ops/sec ±1.47% (93 runs sampled)
JSON short full escape 1 x 2,768,607 ops/sec ±1.85% (86 runs sampled)
this short full escape 1 x 3,232,099 ops/sec ±2.39% (90 runs sampled)
JSON short full escape 2 x 2,834,774 ops/sec ±1.97% (90 runs sampled)
this short full escape 2 x 3,523,461 ops/sec ±2.18% (91 runs sampled)
JSON short minimal escape x 2,720,557 ops/sec ±2.80% (89 runs sampled)
this short minimal escape x 3,498,311 ops/sec ±2.38% (91 runs sampled)
JSON longer non escape x 2,227,777 ops/sec ±2.88% (87 runs sampled)
this longer non escape x 7,197,187 ops/sec ±1.22% (95 runs sampled)
JSON longer full escape x 2,228,338 ops/sec ±1.06% (91 runs sampled)
this longer full escape x 2,130,231 ops/sec ±2.14% (90 runs sampled)
JSON longer minimal escape x 2,408,445 ops/sec ±3.36% (93 runs sampled)
this longer minimal escape x 2,006,347 ops/sec ±1.89% (90 runs sampled)
The benchmarks ran on Node.js 10.2.1 using a Lenovo T450s with an i7-5600u. The "longer" benchmarks are worst case benchmarks.
1.0.1 - Jun 2018
FAQs
Fast JSON string escaping
The npm package json-escaping receives a total of 266 weekly downloads. As such, json-escaping popularity was classified as not popular.
We found that json-escaping demonstrated a not healthy version release cadence and project activity because the last version was released 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
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.