# Best way to re-use javascript methods, error messages across Postman?

**URL:** <https://community.postman.com/t/best-way-to-re-use-javascript-methods-error-messages-across-postman/37860>\
**Category:** Help Hub\
**Created:** [August 3, 2022, 11:28pm UTC](https://community.postman.com/t/best-way-to-re-use-javascript-methods-error-messages-across-postman/37860 "2022-08-03T23:28:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![evidence8321](https://avatars.discourse-cdn.com/v4/letter/e/e274bd/32.png) [@evidence8321](https://community.postman.com/u/evidence8321)\
**Post date:** [August 3, 2022, 11:28pm UTC](https://community.postman.com/t/best-way-to-re-use-javascript-methods-error-messages-across-postman/37860/1 "2022-08-03T23:28:01Z")

</div>

**Best way to re-use javascript methods, error messages across Postman?**

I have several functions that I’d like to replicate across different use cases in various requests and folders within the same collection (I’m using it as a template mostly, so it’ll be pulling in variables externally)

There are many different suggestions in the Postman documentation but what’s the best way to re-use code for such a use case?

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [December 12, 2024, 12:54pm UTC](https://community.postman.com/t/best-way-to-re-use-javascript-methods-error-messages-across-postman/37860/2 "2024-12-12T12:54:14Z")

</div>

Closed on December 12, 2024, 12:54pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
