Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@patagona-technologies/ngraph.fromjson
Advanced tools
Library to load graph from simple json format
Library to load graph from simple json format
// JSON string can be produced by `ngraph.tojson` library
// https://github.com/anvaka/ngraph.tojson
var jsonString = ' {"nodes":[{"id":"hello"},{"id":"world"}],"links":[{"fromId":"hello","toId":"world"}]}'
var fromJSON = require('ngraph.fromjson');
var graph = fromJSON(jsonString)
graph.getNode('hello'); // returns a node;
graph.getLinksCount(); // 1
You can also provide custom transform functions for deserializer:
var jsonString = {
"nodes":[[1,"Custom data"],[2,null]],"links":[[1,2,"Custom link data"]]
};
var fromJSON = require('ngraph.fromjson');
// each element in the input json array is an array. Provide custom transformers
// to parse arrays:
var graph = fromJSON(jsonString,
function nodeLoadTransform(node) {
return { id: node[0], data: node[1] };
},
function linkLoadTransform(link) {
return { fromId: link[0], toId: link[1], data: link[2] };
});
graph.getNode(1); // returns a node, and its data is set to "Custom Data";
graph.hasLink(1, 2); // Returns link, and its data is set to "Custom link data"
With npm do:
npm install ngraph.fromjson
MIT
FAQs
Library to load graph from simple json format
The npm package @patagona-technologies/ngraph.fromjson receives a total of 1 weekly downloads. As such, @patagona-technologies/ngraph.fromjson popularity was classified as not popular.
We found that @patagona-technologies/ngraph.fromjson demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.