title: Node JS, Static Function / Variable Best Practice
body: <p>I have a Java background, I am trying to build a Node JS lib. 
  I have a class in Java like this;</p>
  
  <pre><code>public class MyClass {
      static List&lt;String&gt; myList = initMyList();
      private String something;
  
      public MyClass(String something) {
          validate(something);
          this.something = something;    
      }
  
      public static String doSomething(String something) {
          return doSomethingWithMyList(something);
      }
  
      public String doSomething() {
          return doSomething(something);
      }
  
      private static String doSomethingWithMyList (String something) {
          // do something with list ..
          return something
      }
  }
  </code></pre>
  
  <p>As you can see, it has a static helper method <code>static String doSomething</code> takes String param and non static function <code>String doSomething</code> uses the instance variable, <code>something</code>.</p>
  
  <p>So users can do either <code>MyClass.doSomething(string)</code> or <code>MyClass m = new MyClass(sting); m.doSomething()</code>. The former wouldn't do validation but the later will do the validation in the constructor.</p>
  
  <p>I want to do this in Node JS. And I have this.</p>
  
  <pre><code>// construction function
  function MyClass(something) {
    validate(something);
    this.something = something;
  }
  
  // static variable 
  MyClass.myList = someModule.getList();
  
  // static function
  MyClass.doSomething = function doSomething (something) {
    return something;
  };
  
  // private static
  MyClass._doSeomthingWithMyList = function _doSeomthingWithMyList (something) {
    // do something wiht list
    return something;
  };
  
  
  MyClass.prototype.doSomething = function doSomething() {
    MyClass.doSomething(this.something);
  };
  
  module.export = MyClass;
  </code></pre>
  
  <p>As I am new to Node JS world, I want to make sure that this is right way to implement class with static and non static methods. </p>