
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
ngraph.tojson
Advanced tools
Library to store graph into simple json format
var graph = require('ngraph.graph')();
graph.addLink('hello', 'world');
var toJSON = require('ngraph.tojson');
console.log(toJSON(graph));
// Produces output:
// {"nodes":[{"id":"hello"},{"id":"world"}],"links":[{"fromId":"hello","toId":"world"}]}
You can also provide a custom transform function to transform nodes/edges before they are pushed to the output:
var g = require('ngraph.graph')();
g.addNode(1, { name: 'John' });
g.addNode(2, { name: 'Jim' });
graph.addLink(1, 2, 'Father');
var json = toJSON(g,
function nodeTransform(node) {
return [node.id, node.data];
},
function linkTransform(link) {
return [link.fromId, link.toId, link.data];
});
console.log(json);
// This will produce array of arrays for nodes:
// {
// "nodes": [
// [1, {"name": "John"}],
// [2, {"name": "Jim"}]
// ],
// "links": [[1, 2, "Father"]]
// }
With npm do:
npm install ngraph.tojson
MIT
FAQs
Library to store graph into simple json format
The npm package ngraph.tojson receives a total of 1,032 weekly downloads. As such, ngraph.tojson popularity was classified as popular.
We found that ngraph.tojson 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
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.