
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
json-config-reader
Advanced tools
This module was made for iora, but can be used separately to read any JSON configurations.
json-config-reader reads configurations, parses them, and caches them in case they need to be referenced again.
Reader consists of a simple API.
Reader.read(file, [call])With .read, you can read asynchronously or synchronously depending on if you provide a callback.
var jc = require("json-config-reader");
// Read synchronously
var data = jc.read("some.json");
console.log(data);
// Read asynchronously
jc.read("some.json", function(data){
console.log("data");
});
Note that both refer to the same cache bank.
Reader.purgeCache([file]).purgeCache sets cache values to undefined in the Reader.__cache bank. This is helpful if you update a JSON file mid-script and need to read it again to get the new value.
// Lets say some.json is { "test": 1 }
var data1 = jc.read("some.json");
fs.writeFileSync("some.json", JSON.stringify({"new": "values!"}));
var data2 = jc.read("some.json");
// Both data1 and data2 are the same, because the second `.read` fetched from the cache.
jc.purgeCache("some.json");
var data3 = jc.read("some.json");
// Now we have:
// data1 and data2 = { "test": 1 }
// data3 = { "new": "values!" }
Reader.__cache.__cache is used internally. It's an object that routes file paths to the parsed data (if successfully parsed).
var data1 = jc.read("/home/jamen/some.json");
var data2 = jc.__cache["/home/jamen/some.json"];
// Both data1 and data2 are the same.
Note! You should never have to refer to the Reader.__cache object yourself. Reader.read implements cache lookups, and falls back by reading and parsing the file (then adding that data to the bank).
FAQs
Reads and caches JSON configurations.
We found that json-config-reader 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
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.