
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@jf/json-parse
Advanced tools
Parse a JSON file replacing all files included with their contents. If a file does not exist the text is not replaced.
// a.json
{
"a1" : "Texto del archivo A",
"a2" : "archivo a.json"
}
// b.json
{
"b1" : "Archivo B",
"b2" : "./a.json"
}
// index.json
{
"a" : "a.json",
"b" : "./b.json",
"c" : "Clave c",
"d" : "d.json",
"e" : "/tmp/e.json"
}
const jfJsonParse = require('jf-json-parse');
console.log(
jfJsonParse('./index.json'),
{
'/tmp/e.json' : '"fake content"'
}
);
/*
{
"a": {
"a1": "Texto del archivo A",
"a2": "archivo a.json"
},
"b": {
"b1": "Archivo B",
"b2": {
"a1": "Texto del archivo A",
"a2": "archivo a.json"
}
},
"c": "Clave c",
"d": "d.json",
"e": "fake content"
}
*/
You can pass an object as second parameter as cache. If the key exists in cache, this value will be used instead file on disk.
After parse JSON, in cache object you will have all the files that were tried to read.
So you can pass the same cache object between calls to jfJsonParse and no files
will be read twice.
const jfJsonParse = require('jf-json-parse');
const cache = {};
jfJsonParse('./index.json', cache);
// There is no file readings because for this JSON all files are in cache.
jfJsonParse('./index.json', cache);
// For this JSON only will read x.json because there is not in cache.
// z.json: { "a": "a.json", x: "x.json" }
jfJsonParse('./z.json', cache);
FAQs
Parse a JSON file replacing all files included with their contents.
We found that @jf/json-parse 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.