
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
jsonld2graphobject
Advanced tools
JSON-LD makes working with RDF easier, but it forces data into a tree structure. JSON 2 Graph Object makes a true graph from Object literals.
JSON-LD is great for making RDF easy for JavaScript developers, but it's not perfect.
{
"@context": {
"friend": { "@type": "@id" }
},
"@id": "http://example.com/friend1",
"friend": {
"@id": "http://example.com/friend2",
"friend": "http://example.com/friend1"
}
}
The above example is not a true graph, as the friend field in friend2 is simply the id of the friend, not the friend itself.
npm i jsonld2graphobject
Provide any compliant JSON-LD document as well as the id for the return node.
import { jsonld2graphobject } from "jsonld2graphobject";
async function run() {
const friend1 = await jsonld2graphobject(
{
"@context": {
"friend": { "@type": "@id" }
},
"@id": "http://example.com/friend1",
"friend": {
"@id": "http://example.com/friend2",
"friend": "http://example.com/friend1"
}
},
"http://example.com/friend1",
{ excludeContext: false } // excludeContext defaults to false
);
// Prints friend 1
console.log(friend1.friend.friend.friend.friend.friend.friend.friend.friend.friend.friend);
}
run();
FAQs
Converts JSON-LD to an Object Literal Graph
The npm package jsonld2graphobject receives a total of 1,509 weekly downloads. As such, jsonld2graphobject popularity was classified as popular.
We found that jsonld2graphobject 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

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.