# neo4j-stream-deserializer

> Transforms neo4j responses to an easier-to-use format.

Latest version **0.0.1** (published 2014-01-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install neo4j-stream-deserializer
pnpm add neo4j-stream-deserializer
yarn add neo4j-stream-deserializer
bun add neo4j-stream-deserializer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2014-01-30 |
| First published | 2014-01-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Brian Gates |
| Maintainers | brian.g.gates |
| Keywords | neo4j, cypher, steam, serialize, format, graph, node |

## Links

- npm: https://www.npmjs.com/package/neo4j-stream-deserializer
- Repository: https://github.com/brian-gates/neo4j-stream-deserializer
- Issues: https://github.com/brian-gates/neo4j-stream-deserializer/issues
- npm.io page: https://npm.io/package/neo4j-stream-deserializer

## Dependencies (2)

- [request](https://npm.io/package/request.md) ~2.33.0
- [JSONStream](https://npm.io/package/JSONStream.md) ~0.7.1

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2014-01-30
- 0.0.0 — 2014-01-30

## README

# neo4j-stream-deserializer [![Build Status](https://travis-ci.org/brian-gates/neo4j-stream-deserializer.png?branch=master)](https://travis-ci.org/brian-gates/neo4j-stream-deserializer) [![devDependency Status](https://david-dm.org/brian-gates/neo4j-stream-deserializer.png?theme=shields.io)](https://david-dm.org/brian-gates/neo4j-stream-deserializer.png#info=devDependencies)

Project no longer maintained since [cypher-stream](https://github.com/brian-gates/cypher-stream) now depends on [oboe.js](https://github.com/jimhigson/oboe.js) instead.

Streams neo4j responses as formatted objects.

A typical neo4j response:

```
{"columns":["n"],"data":[[{"extensions":{},"paged_traverse":"http://localhost:7474/db/data/node/4307/paged/traverse/{returnType}{?pageSize,leaseTime}","labels":"http://localhost:7474/db/data/node/4307/labels","outgoing_relationships":"http://localhost:7474/db/data/node/4307/relationships/out","traverse":"http://localhost:7474/db/data/node/4307/traverse/{returnType}","all_typed_relationships":"http://localhost:7474/db/data/node/4307/relationships/all/{-list|&|types}","property":"http://localhost:7474/db/data/node/4307/properties/{key}","all_relationships":"http://localhost:7474/db/data/node/4307/relationships/all","self":"http://localhost:7474/db/data/node/4307","properties":"http://localhost:7474/db/data/node/4307/properties","outgoing_typed_relationships":"http://localhost:7474/db/data/node/4307/relationships/out/{-list|&|types}","incoming_relationships":"http://localhost:7474/db/data/node/4307/relationships/in","incoming_typed_relationships":"http://localhost:7474/db/data/node/4307/relationships/in/{-list|&|types}","create_relationship":"http://localhost:7474/db/data/node/4307/relationships","data":{"test":true,"uuid":"27d1b700-88aa-11e3-9992-d7608d571cea"}}],[{"extensions":{},"paged_traverse":"http://localhost:7474/db/data/node/4308/paged/traverse/{returnType}{?pageSize,leaseTime}","labels":"http://localhost:7474/db/data/node/4308/labels","outgoing_relationships":"http://localhost:7474/db/data/node/4308/relationships/out","traverse":"http://localhost:7474/db/data/node/4308/traverse/{returnType}","all_typed_relationships":"http://localhost:7474/db/data/node/4308/relationships/all/{-list|&|types}","property":"http://localhost:7474/db/data/node/4308/properties/{key}","all_relationships":"http://localhost:7474/db/data/node/4308/relationships/all","self":"http://localhost:7474/db/data/node/4308","properties":"http://localhost:7474/db/data/node/4308/properties","outgoing_typed_relationships":"http://localhost:7474/db/data/node/4308/relationships/out/{-list|&|types}","incoming_relationships":"http://localhost:7474/db/data/node/4308/relationships/in","incoming_typed_relationships":"http://localhost:7474/db/data/node/4308/relationships/in/{-list|&|types}","create_relationship":"http://localhost:7474/db/data/node/4308/relationships","data":{"test":true,"uuid":"2ed844b0-88aa-11e3-9992-d7608d571cea"}}],[{"extensions":{},"paged_traverse":"http://localhost:7474/db/data/node/4309/paged/traverse/{returnType}{?pageSize,leaseTime}","labels":"http://localhost:7474/db/data/node/4309/labels","outgoing_relationships":"http://localhost:7474/db/data/node/4309/relationships/out","traverse":"http://localhost:7474/db/data/node/4309/traverse/{returnType}","all_typed_relationships":"http://localhost:7474/db/data/node/4309/relationships/all/{-list|&|types}","property":"http://localhost:7474/db/data/node/4309/properties/{key}","all_relationships":"http://localhost:7474/db/data/node/4309/relationships/all","self":"http://localhost:7474/db/data/node/4309","properties":"http://localhost:7474/db/data/node/4309/properties","outgoing_typed_relationships":"http://localhost:7474/db/data/node/4309/relationships/out/{-list|&|types}","incoming_relationships":"http://localhost:7474/db/data/node/4309/relationships/in","incoming_typed_relationships":"http://localhost:7474/db/data/node/4309/relationships/in/{-list|&|types}","create_relationship":"http://localhost:7474/db/data/node/4309/relationships","data":{"test":true,"uuid":"36204830-88aa-11e3-9992-d7608d571cea"}}],[{"extensions":{},"paged_traverse":"http://localhost:7474/db/data/node/4310/paged/traverse/{returnType}{?pageSize,leaseTime}","labels":"http://localhost:7474/db/data/node/4310/labels","outgoing_relationships":"http://localhost:7474/db/data/node/4310/relationships/out","traverse":"http://localhost:7474/db/data/node/4310/traverse/{returnType}","all_typed_relationships":"http://localhost:7474/db/data/node/4310/relationships/all/{-list|&|types}","property":"http://localhost:7474/db/data/node/4310/properties/{key}","all_relationships":"http://localhost:7474/db/data/node/4310/relationships/all","self":"http://localhost:7474/db/data/node/4310","properties":"http://localhost:7474/db/data/node/4310/properties","outgoing_typed_relationships":"http://localhost:7474/db/data/node/4310/relationships/out/{-list|&|types}","incoming_relationships":"http://localhost:7474/db/data/node/4310/relationships/in","incoming_typed_relationships":"http://localhost:7474/db/data/node/4310/relationships/in/{-list|&|types}","create_relationship":"http://localhost:7474/db/data/node/4310/relationships","data":{"test":true,"uuid":"3c4bdf30-88aa-11e3-9992-d7608d571cea"}}],[{"extensions":{},"paged_traverse":"http://localhost:7474/db/data/node/4311/paged/traverse/{returnType}{?pageSize,leaseTime}","labels":"http://localhost:7474/db/data/node/4311/labels","outgoing_relationships":"http://localhost:7474/db/data/node/4311/relationships/out","traverse":"http://localhost:7474/db/data/node/4311/traverse/{returnType}","all_typed_relationships":"http://localhost:7474/db/data/node/4311/relationships/all/{-list|&|types}","property":"http://localhost:7474/db/data/node/4311/properties/{key}","all_relationships":"http://localhost:7474/db/data/node/4311/relationships/all","self":"http://localhost:7474/db/data/node/4311","properties":"http://localhost:7474/db/data/node/4311/properties","outgoing_typed_relationships":"http://localhost:7474/db/data/node/4311/relationships/out/{-list|&|types}","incoming_relationships":"http://localhost:7474/db/data/node/4311/relationships/in","incoming_typed_relationships":"http://localhost:7474/db/data/node/4311/relationships/in/{-list|&|types}","create_relationship":"http://localhost:7474/db/data/node/4311/relationships","data":{"test":true,"uuid":"43245800-88aa-11e3-9992-d7608d571cea"}}],[{"extensions":{},"paged_traverse":"http://localhost:7474/db/data/node/4312/paged/traverse/{returnType}{?pageSize,leaseTime}","labels":"http://localhost:7474/db/data/node/4312/labels","outgoing_relationships":"http://localhost:7474/db/data/node/4312/relationships/out","traverse":"http://localhost:7474/db/data/node/4312/traverse/{returnType}","all_typed_relationships":"http://localhost:7474/db/data/node/4312/relationships/all/{-list|&|types}","property":"http://localhost:7474/db/data/node/4312/properties/{key}","all_relationships":"http://localhost:7474/db/data/node/4312/relationships/all","self":"http://localhost:7474/db/data/node/4312","properties":"http://localhost:7474/db/data/node/4312/properties","outgoing_typed_relationships":"http://localhost:7474/db/data/node/4312/relationships/out/{-list|&|types}","incoming_relationships":"http://localhost:7474/db/data/node/4312/relationships/in","incoming_typed_relationships":"http://localhost:7474/db/data/node/4312/relationships/in/{-list|&|types}","create_relationship":"http://localhost:7474/db/data/node/4312/relationships","data":{"test":true,"uuid":"4a41c910-88aa-11e3-9992-d7608d571cea"}}],[{"extensions":{},"paged_traverse":"http://localhost:7474/db/data/node/4313/paged/traverse/{returnType}{?pageSize,leaseTime}","labels":"http://localhost:7474/db/data/node/4313/labels","outgoing_relationships":"http://localhost:7474/db/data/node/4313/relationships/out","traverse":"http://localhost:7474/db/data/node/4313/traverse/{returnType}","all_typed_relationships":"http://localhost:7474/db/data/node/4313/relationships/all/{-list|&|types}","property":"http://localhost:7474/db/data/node/4313/properties/{key}","all_relationships":"http://localhost:7474/db/data/node/4313/relationships/all","self":"http://localhost:7474/db/data/node/4313","properties":"http://localhost:7474/db/data/node/4313/properties","outgoing_typed_relationships":"http://localhost:7474/db/data/node/4313/relationships/out/{-list|&|types}","incoming_relationships":"http://localhost:7474/db/data/node/4313/relationships/in","incoming_typed_relationships":"http://localhost:7474/db/data/node/4313/relationships/in/{-list|&|types}","create_relationship":"http://localhost:7474/db/data/node/4313/relationships","data":{"test":true,"uuid":"50743de0-88aa-11e3-9992-d7608d571cea"}}],[{"extensions":{},"paged_traverse":"http://localhost:7474/db/data/node/4314/paged/traverse/{returnType}{?pageSize,leaseTime}","labels":"http://localhost:7474/db/data/node/4314/labels","outgoing_relationships":"http://localhost:7474/db/data/node/4314/relationships/out","traverse":"http://localhost:7474/db/data/node/4314/traverse/{returnType}","all_typed_relationships":"http://localhost:7474/db/data/node/4314/relationships/all/{-list|&|types}","property":"http://localhost:7474/db/data/node/4314/properties/{key}","all_relationships":"http://localhost:7474/db/data/node/4314/relationships/all","self":"http://localhost:7474/db/data/node/4314","properties":"http://localhost:7474/db/data/node/4314/properties","outgoing_typed_relationships":"http://localhost:7474/db/data/node/4314/relationships/out/{-list|&|types}","incoming_relationships":"http://localhost:7474/db/data/node/4314/relationships/in","incoming_typed_relationships":"http://localhost:7474/db/data/node/4314/relationships/in/{-list|&|types}","create_relationship":"http://localhost:7474/db/data/node/4314/relationships","data":{"test":true,"uuid":"56d7fbe0-88aa-11e3-9992-d7608d571cea"}}],[{"extensions":{},"paged_traverse":"http://localhost:7474/db/data/node/4315/paged/traverse/{returnType}{?pageSize,leaseTime}","labels":"http://localhost:7474/db/data/node/4315/labels","outgoing_relationships":"http://localhost:7474/db/data/node/4315/relationships/out","traverse":"http://localhost:7474/db/data/node/4315/traverse/{returnType}","all_typed_relationships":"http://localhost:7474/db/data/node/4315/relationships/all/{-list|&|types}","property":"http://localhost:7474/db/data/node/4315/properties/{key}","all_relationships":"http://localhost:7474/db/data/node/4315/relationships/all","self":"http://localhost:7474/db/data/node/4315","properties":"http://localhost:7474/db/data/node/4315/properties","outgoing_typed_relationships":"http://localhost:7474/db/data/node/4315/relationships/out/{-list|&|types}","incoming_relationships":"http://localhost:7474/db/data/node/4315/relationships/in","incoming_typed_relationships":"http://localhost:7474/db/data/node/4315/relationships/in/{-list|&|types}","create_relationship":"http://localhost:7474/db/data/node/4315/relationships","data":{"test":true,"uuid":"5df3bf40-88aa-11e3-9992-d7608d571cea"}}],[{"extensions":{},"paged_traverse":"http://localhost:7474/db/data/node/4316/paged/traverse/{returnType}{?pageSize,leaseTime}","labels":"http://localhost:7474/db/data/node/4316/labels","outgoing_relationships":"http://localhost:7474/db/data/node/4316/relationships/out","traverse":"http://localhost:7474/db/data/node/4316/traverse/{returnType}","all_typed_relationships":"http://localhost:7474/db/data/node/4316/relationships/all/{-list|&|types}","property":"http://localhost:7474/db/data/node/4316/properties/{key}","all_relationships":"http://localhost:7474/db/data/node/4316/relationships/all","self":"http://localhost:7474/db/data/node/4316","properties":"http://localhost:7474/db/data/node/4316/properties","outgoing_typed_relationships":"http://localhost:7474/db/data/node/4316/relationships/out/{-list|&|types}","incoming_relationships":"http://localhost:7474/db/data/node/4316/relationships/in","incoming_typed_relationships":"http://localhost:7474/db/data/node/4316/relationships/in/{-list|&|types}","create_relationship":"http://localhost:7474/db/data/node/4316/relationships","data":{"test":true,"uuid":"64217920-88aa-11e3-9992-d7608d571cea"}}]]}
```

# Parsing a cypher request

``` js
var Neo4jStreamDeserializer = require('neo4j-stream-deserializer');
var request                 = require('request');

request.post({
    url     : 'http://localhost:7474/db/data/cypher',
    form    : { query: 'match (n:User) return n' },
    headers : { "X-Stream": true, "Accept": "application/json" }
  })
  .pipe(new Neo4jStreamDeserializer())
  .on('data', function (result){
    console.log(result.user);
  })
  .on('end', function() {
    console.log('all done');
  })
;

```

# Reading from a file


``` js
var should                  = require("should");
var Neo4jStreamDeserializer = require('../index');
var fs                      = require('fs');

describe('Neo4j deserializer', function () {

  it('should be able to parse a file', function (done) {
    var results = 0;
    fs
      .createReadStream('./test/mock/neo4j_response.json')
      .pipe(new Neo4jStreamDeserializer())
      .on('data', function (result){
        results++;
        result.n.test.should.be.ok;
      })
      .on('end', function() {
        results.should.eql(10);
        done();
      })
    ;
  });
});

```

---
_Source: https://npm.io/package/neo4j-stream-deserializer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
