node-neo4j
node-neo4j copied to clipboard
code cleanup and getting the library ready for the new 2.0.0 release
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.
- like commit to a coding standard and format the files accordingly
- and try to fix as many old unit tests as possible. or at least make a list of the ones that are broken.
Is there any coding guideline?
@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
@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);
}