npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

simpleneo4js

v0.0.14

Published

A (very) simple node.js connection client for Neo4j

Downloads

12

Readme

simpleNeo4js

A (very) simple node.js connection client for Neo4j

###Usage

The client can be used via the transactional endpoint, at present it does not do more than one query per transaction (it uses '/db/data/transaction/commit')

var cypherQuery = 'CREATE (n:User {name: {name}, age: {age} }) RETURN n';
var queryParameters = {
    name: 'Billy Bob',
    age: 34
};

var queryResult = simpleNeo4js.query({
    cypherQuery: cypherQuery,
    parameters: queryParameters
});

queryResult.on('data', function (data) {
    //a key value dictionary is returned for every row returned from neo4j
    //this allows for returning non standard properties like Collect(n)
    //the return value from the cypher query was n, therefore the data has
    //a property n with the new data
    assert.equal(data.n.name, 'Billy Bob', 'User with name is same as passed');
    assert.equal(data.n['name'], 'Billy Bob', 'User with name is same as passed');
    assert.equal(data.n.age, 34, 'User with age is same as passed');
    done();
});

queryResult.on('error', function (error) {
    done(error);
});

The client can also be used with the batched endpoint, this allows for multiple cypher queries to be executed in one transaction. (this uses '/db/data/batch')

var queries = [{
    cypher: 'MATCH (n:User) RETURN n',
    parameters: { }
},
{
    cypher: 'MATCH (n:User) RETURN n.age',
    parameters: { }
}];

var queryResult = simpleNeo4js.batchedQuery({
    queries: queries
});

queryResult.on('data', function (newNodes) {
    assert.equal(newNodes.length, 2, 'Two query results were returned as two were requested');
    assert.equal(newNodes[0].length, 2, 'Two nodes were returned');
    assert.equal(newNodes[1].length, 2, 'Two results were returned');

    var names = newNodes[0].map(function (item) {
        return item.n.name;
    });

    assert.ok(names.indexOf('Johno Riso') > -1, "Names returned contains John Riso");
    assert.ok(names.indexOf('Billy Bob') > -1, "Names returned contains Billy Bob");

    var ages = newNodes[1].map(function (item) {
        return item['n.age'];
    });

    assert.equal(ages[0], 34, 'First node age = 34');
    assert.equal(ages[1], 18, 'Second result age = 18');

    done();
});

###Implementation

The client is a very thin wrapper and hits the Neo4j REST transactional and batched endpoint.