Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
true-json-bigint
Advanced tools
Enhanced fork of json-bigint that allows parsing all big number values in JSON strings.
This is a module for parsing JSON strings to JSON objects and stringifying JSON objects to JSON strings. It is a fork of json-bigint 0.3.0, but enhances the original module in the following aspects.
The module generally works in the same way as the original one. Use the following command to add true-json-bigint into the node_moduels directory of your application:
$ npm install true-json-bigint
Parse JSON strings as described in the next example:
const JSONbig = require('true-json-bigint');
const json = '{"smallNumber": 1, "bigNumber" : 987654321123456789987654321}';
const result = JSONbig.parse(json);
console.log(result);
// { smallNumber: 1, bigNumber: BigNumber { s: 1, e: 26, c: [ 9876543211234, 56789987654321 ] } }
As can be seen in the following example, stringifying a JSON object that contains a big number can easily be done by using the stringify function of this module.
const JSONbig = require('true-json-bigint');
const BigNumber = require('bignumber.js');
const json = {}
json.smallNumber = 1
json.bigNumber = BigNumber('987654321123456789987654321');
const result = JSONbig.stringify(json);
console.log(result);
// {"smallNumber":1,"bigNumber":9.87654321123456789987654321e+26}
See the README of json-bigint 0.3.0 for further details on how to use this module.
FAQs
Enhanced fork of json-bigint that allows parsing all big number values in JSON strings.
We found that true-json-bigint 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
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.