When implementing Node.js-compatible APIs, ensure exact behavioral matching with Node.js, including export structures, method signatures, return types, and property availability. This maintains compatibility with existing Node.js code and meets developer expectations.

Key areas to verify:

Example from the discussions:

// Correct: Match Node.js default export expectation
export default Module; // Instead of object with methods

// Correct: Provide expected methods even if not fully implemented
server.address(): AddressInfo | string | null {
  return { port: this.port, family: 'IPv4', address: '0.0.0.0' };
}

// Correct: Use version-appropriate compatibility flags
if (!Cloudflare.compatibilityFlags.remove_nodejs_compat_eol_v22) {
  // Export as undefined in v22 to match Node.js behavior
}

This ensures seamless migration of existing Node.js applications and prevents unexpected runtime failures due to missing properties or methods.