philippkueng / node-neo4j

Neo4j REST API wrapper for Node.js
MIT License
211 stars 44 forks source link

code cleanup and getting the library ready for the new 2.0.0 release #24

Open philippkueng opened 10 years ago

philippkueng commented 10 years ago

So far all tests from our 2.0.0-RC1 release are also passing for 2.0.0-GA of neo4j.

However there are still a couple of things that should be refined before we make a proper release.

reneolivo commented 10 years ago

Is there any coding guideline?

philippkueng commented 10 years ago

@reneolivo there are a couple of javascript coding guidelines around. I think sticking to the one from Crockford makes sense http://javascript.crockford.com/code.html

todorus commented 8 years ago

@philippkueng Are you also considering cleaning up the api as well? Right now every method seems to be attached to the monolithic neo4j object whenever the need has arisen for that functionality. I'd love for the api to be more structured around the concepts within neo4j.

var neo4j = require('node-neo4j');
var db = new neo4j(url);

db.nodes.insert(); // = db.insertNode()
db.nodes.delete(); // = db.deleteNode()
db.nodes.read(); // = db.readNode()

db.nodes.labels.insert(); // = db.addLabelsToNode()
//etc

Internally we could keep the neo4j class as a facade to have backwards compatibility

Neo4j.prototype.insertNode = function(node, labels, callback){
  this.nodes.insert(node, labels, callback);
}