Please visit node_classpath_builder for information on installing with npm.
This node's lib helps with the building of Java-Classpath.
Sample code:
var classpathBuilder = require('./classpathBuilder.js');
classpathBuilder.build('<Directory which contains jars>', function(classpath){
console.log();
});