some common code snippet for writing v8 module