To enable built-in Node.js APIs and polyfills, add the nodejs_compat compatibility flag to yourWrangler configuration file. This also enables nodejs_compat_v2 as long as your compatibility date is 2024-09-23 or later.Learn more about the Node.js compatibility flag and v2.
Thenode:path ↗ module provides utilities for working with file and directory paths. Thenode:path module can be accessed using:
importpath from"node:path";path.join("/foo","bar","baz/asdf","quux","..");// Returns: '/foo/bar/baz/asdf'Refer to theNode.js documentation forpath ↗ for more information.