
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
@ahwayakchih/logify
Advanced tools
Turn objects/values into JSON string safely, keep result easy on the eyes
Yet another implementation of turning objects and/or values into a JSON string.
This one strives to be safe (JSON.stringify will throw on bigint and circular references) and result in a JSON that's easy on the eyes while keeping enough information:
"@one.two","@@one.two",undefined values are exported as an empty string, e.g., "",bigint values are exported as a string, e.g., "5n",Buffer values are exported as a string with it's data shown as hexadecimal, e.g., "[42]",Infinity values are exported as a string, i.e., "Infinity",NaN values are exported as a string, i.e., "NaN","<text".It's meant to be used for console.log-like output: for a quick check what's going on while debugging, and for testers to be able to quickly copy&paste information to developers.
Do not use it to store data! While it's output can be parsed back to objects, result will differ from the original data.
npm install @ahwayakchih/logify
or:
npm install https://github.com/ahwayakchih/logify
Example code:
const logify = require('logify');
const circular = {
text: 'test'
};
circular.circular = circular;
const o = {};
o.one = 1;
o.two = "two";
o.three = undefined;
o.four = null;
o.five = 5n;
o.six = {
oo: o,
a: circular
};
o.seven = o;
o.eight = circular;
o.nine = function nine () { return 'Hello'; };
o.ten = () => 'World!';
o.eleven = {
f1: function () {},
f2: () => {}
};
o.twelve = Buffer.from('\x42');
o.thirteen = Infinity;
o.fourteen = NaN;
o.fifteen = [1,'2',circular,null,Infinity,NaN,15n,undefined];
o.sixteen = '<hack';
console.log(logify(o));
It should output something like this:
{
"one": 1,
"two": "<two",
"three": "",
"four": null,
"five": "5n",
"six": {
"oo": "@@",
"a": {
"text": "<test",
"circular": "@@six.a"
}
},
"seven": "@@",
"eight": "@six.a",
"eleven": {},
"twelve": "[42]",
"thirteen": "Infinity",
"fourteen": "NaN",
"fifteen": [
1,
"<2",
"@six.a",
null,
"Infinity",
"NaN",
"15n",
""
],
"sixteen": "<<hack"
}
By enforcing empty spacer:
console.log(logify(o, ''));
You can get output similar to default JSON.stringify:
{"one":1,"two":"<two","three":"","four":null,"five":"5n","six":{"oo":"@@","a":{"text":"<test","circular":"@@six.a"}},"seven":"@@","eight":"@six.a","eleven":{},"twelve":"[42]","thirteen":"Infinity","fourteen":"NaN","fifteen":[1,"<2","@six.a",null,"Infinity","NaN","15n",""],"sixteen":"<<hack"}
Logify uses features from ES2015, so it should be compatible with most of the up-to-date browsers and Node.js. To make InternetExplorer use logify, you'll probably need some pollyfills and/or additional compile stage, e.g., using Babel.
Tests use features from ES2020, e.g., bigints (1n), so Node.js v12+ is required.
To generate documentation for this module, clone it from repository (package does not include required files) and use:
npm run doc
It will create HTML files inside logify/reports/jsdoc directory.
To run tests, clone module from repository and use:
npm test
To check coverage, use:
npm run checkCoverage
To check for any linting issues use:
npm run checkStyle
FAQs
Turn objects/values into JSON string safely, keep result easy on the eyes
We found that @ahwayakchih/logify 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.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.