A commonjs implementation