Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@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): Promise
The 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): Promise
The 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
The npm package @cheprasov/json-web-worker receives a total of 0 weekly downloads. As such, @cheprasov/json-web-worker popularity was classified as not popular.
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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.