commonjs wrapper for custom code