
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
@cheprasov/json-web-worker
Advanced tools
The library for parse / stringify JSON in different thread via Web Workers
The library for parse / stringify JSON in different thread via Web Workers.
Promise.catch allows to receive an error thrown on json parse/stringify.> npm install @cheprasov/json-web-worker
import { jsonWebWorker } from '@cheprasov/json-web-worker';
import { jsonWebWorker } from '@cheprasov/json-web-worker';
// Parse via Web Worker
jsonWebWorker.parse('{"a": "b"}')
.then(result => {
console.log('Result:', result);
}).catch(e => {
console.log('Error:', e);
});
// Stringify via Web Worker
jsonWebWorker.stringify({ a: 10, b: [1, 2, 3] }, 2)
.then(result => {
console.log('Result:', result);
}).catch(e => {
console.log('Error:', e);
});
import { jsonWebWorker, parse, stringify } from '@cheprasov/json-web-worker';
jsonWebWorker.parse(text): Promise or parse(text): PromiseThe method executes JSON.parse in a thread via Web Worker
See more here https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse
arguments:
text - string - The string to parse as JSON.Promise.Example:
import { jsonWebWorker, parse } from '@cheprasov/worker-thread';
jsonWebWorker.parse('{"a": "b"}')
.then(result => {
console.log('Result:', result);
}).catch(e => {
console.log('Error:', e);
});
jsonWebWorker.stringify(value, space): Promise or stringify(value, space): PromiseThe method executes JSON.stringify in a thread via Web Worker
See more here https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
arguments:
value - string - The value to convert to a JSON string.space - optional, string or number, object that's used to insert white space into the output JSON string for readability purposes.Promise.Example:
import { jsonWebWorker, parse } from '@cheprasov/worker-thread';
jsonWebWorker.stringify({ a: 10, b: [1, 2, 3] }, 2)
.then(result => {
console.log('Result:', result);
}).catch(e => {
console.log('Error:', e);
});
Feel free to fork project, fix bugs, write tests and finally request for pull
FAQs
The library for parse / stringify JSON in different thread via Web Workers
We found that @cheprasov/json-web-worker 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
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.