To use a 3rd party library, you’ll need to move your project from the UI tool to the Zapier CLI. From there you can import moment from npm, import it and use it.
Instructions on exporting a UI-based project and continuing work in the CLI: https://platform.zapier.com/docs/export
Key differences in capabilities between the (current) Platform UI tool and the CLI: https://platform.zapier.com/docs/vs
https://zapier.com/developer/documentation/v2/scripting/#available-libraries is actually documentation for the legacy Web Builder tool/platform. It’s a common source of confusion. As we’re about a month away from retiring the legacy tool, we’re looking forward to removing that section of content.