🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

graphson

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphson

JavaScript GraphSON reader/writer

0.0.1
latest
Source
npm
Version published
Weekly downloads
1
-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

graphson

GraphSON file format parsing library using Node.js Streams

Install

npm install graphson --save

Example

Reading a graphson file in Node.js

var fs = require('fs');
var GraphSON = require('graphson');

// Create a readable stream for a given file
var stream = fs.createReadStream('/path/to/file.graphson');

// Start parsing. Will emit 'vertex', 'edge' and 'element' events.
var g = GraphSON.parse(stream);

g.on('vertex', function(vertex) {
  console.log("Vertex:", vertex);
});

g.on('edge', function(edge) {
  console.log("Edge:", edge);
});

g.on('element', function(element) {
  // console.log('Element:', element);
});

g.on('end', function() {
  console.log('Reached end of GraphSON file');
});

Performance

This library parses approximately 100 000 vertices per second on my laptop (using 4 properties vertices stored in a ~10.8 Mb file).

Keywords

tinkerpop

FAQs

Package last updated on 13 Jul 2014

Did you know?

Socket

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.

Install

Related posts