# Not able to use npm package in postman

**URL:** <https://community.postman.com/t/not-able-to-use-npm-package-in-postman/19372>\
**Category:** Help Hub\
**Tags:** npm\
**Created:** [January 21, 2021, 5:54am UTC](https://community.postman.com/t/not-able-to-use-npm-package-in-postman/19372 "2021-01-21T05:54:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![thefierycoder](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@thefierycoder](https://community.postman.com/u/thefierycoder)\
**Post date:** [January 21, 2021, 5:54am UTC](https://community.postman.com/t/not-able-to-use-npm-package-in-postman/19372/1 "2021-01-21T05:54:53Z")

</div>

Hello Everyone,  
I want to use npm package in my collection. But I am not able to find any way to do that.  
I want to use this [npm package](https://www.npmjs.com/package/get-youtube-id)  
Please anyone help me with this

---

<div class="post-metadata">

**Author:** ![taehoshino](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/taehoshino/32/6608_2.png) [@taehoshino](https://community.postman.com/u/taehoshino)\
**Post date:** [January 21, 2021, 6:17am UTC](https://community.postman.com/t/not-able-to-use-npm-package-in-postman/19372/2 "2021-01-21T06:17:50Z")

</div>

Hi @thefierycoder! 👋

The supported external libraries are in this list:

> **[Postman JavaScript reference](https://learning.postman.com/docs/writing-scripts/script-references/postman-sandbox-api-reference/#using-external-libraries)**

As it is not included in the supported list, it cannot be used within Postman simply by _requiring_ it.  
But as discussed in the following blog article, you can leverage JavaScript `eval()` function to reuse any JavaScript library.

> **[API Testing Tips from a Postman Professional | Postman Blog](https://blog.postman.com/api-testing-tips-from-a-postman-professional/#tip-5-reuse-code)**
>
> As an engineer at Postman, I talk to a lot of people who use Postman to test their APIs. Over the years, I’ve picked up 10 tips and tricks for simplifying and automating the task of API testing. TIP #1: write tests The first step to API testing is to...

Hope this helps 🙃

---

<div class="post-metadata">

**Author:** ![thefierycoder](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@thefierycoder](https://community.postman.com/u/thefierycoder)\
**Post date:** [January 21, 2021, 9:29am UTC](https://community.postman.com/t/not-able-to-use-npm-package-in-postman/19372/3 "2021-01-21T09:29:39Z")

</div>

Thanks for your reply.  
But I don’t get How to use [this package](https://www.npmjs.com/package/get-title-at-url) using eval() function.  
Could you expain me How to do that in postman?

---

<div class="post-metadata">

**Author:** ![thefierycoder](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@thefierycoder](https://community.postman.com/u/thefierycoder)\
**Post date:** [January 21, 2021, 3:16pm UTC](https://community.postman.com/t/not-able-to-use-npm-package-in-postman/19372/4 "2021-01-21T15:16:20Z")

</div>

Anyone knows how to use npm package, please help me

---

<div class="post-metadata">

**Author:** ![thefierycoder](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@thefierycoder](https://community.postman.com/u/thefierycoder)\
**Post date:** [January 22, 2021, 1:58pm UTC](https://community.postman.com/t/not-able-to-use-npm-package-in-postman/19372/5 "2021-01-22T13:58:31Z")

</div>

@taehoshino Do you have any idea how to use npm package using eval function in postman?

---

<div class="post-metadata">

**Author:** ![praveendvd](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/praveendvd/32/6796_2.png) [@praveendvd](https://community.postman.com/u/praveendvd)\
**Post date:** [January 22, 2021, 4:36pm UTC](https://community.postman.com/t/not-able-to-use-npm-package-in-postman/19372/6 "2021-01-22T16:36:59Z")

</div>

you cannot use packages that are not supported in the postman sandbox as mentioned.

You can use cheerio.js module if you are looking to parse html

---

<div class="post-metadata">

**Author:** ![taehoshino](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/taehoshino/32/6608_2.png) [@taehoshino](https://community.postman.com/u/taehoshino)\
**Post date:** [January 27, 2021, 4:56am UTC](https://community.postman.com/t/not-able-to-use-npm-package-in-postman/19372/7 "2021-01-27T04:56:13Z")

</div>

Hey @thefierycoder 👋  
I have not tried this myself, but [this thread](https://stackoverflow.com/questions/31157749/external-library-in-postman) has some example that might be useful 🙂

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [April 14, 2025, 9:27am UTC](https://community.postman.com/t/not-able-to-use-npm-package-in-postman/19372/8 "2025-04-14T09:27:19Z")

</div>

Hey everyone 👋,

We have released support for external packages in the latest version of Postman, you can read more about this here:

> <https://github.com/postmanlabs/postman-app-support/issues/13542>
>
> We’re excited to announce a powerful new capability in Postman’s scripting envir…onment — support for \*\*external public packages from the \[NPM\](https://www.npmjs.com/) and \[JSR\](https://jsr.io/) registries\*\*! 🎉
> 
> With this release, you can now seamlessly supercharge your pre-request and post-response scripts using your favorite open-source packages right from inside Postman.
> 
> 
> \## 📽️ Feature Walkthrough
> 
> Getting up and running is easy:
> 1. Open the \*\*Scripts\*\* tab (Pre-request or Post-response) for any HTTP Request.
> 2. Click on the \*\*Packages\*\* dropdown to search and select a package from \*\*NPM\*\* or \*\*JSR\*\*.
> 3. Or, directly import packages into your script using \[pm.require\](https://learning.postman.com/docs/tests-and-scripts/write-scripts/postman-sandbox-api-reference/#import-packages-from-scripts). Examples:
> \`\`\`js
> // From NPM
> const lodash = pm.require("npm:lodash@4.17.21");
> 
> // From JSR
> const shortUUID = pm.require("jsr:@opensrc/short-uuid")
> \`\`\`
> 
> https://github.com/user-attachments/assets/c39c4951-f92d-4477-8b68-f2a573c80141
> 
> \> 📚 Read the \[full documentation here\](https://learning.postman.com/docs/tests-and-scripts/write-scripts/packages/external-package-registries/) for more examples, caveats, and advanced usage.
> 
> \## 🛠️ Planned Work Ahead
> 
> We’re just getting started! Here's what we're working on next:
> \- \*\*Adding auto-suggestions\*\* in the scripts tab for packages you import — making it even easier to discover and use package APIs as you type.
> \- \*\*Extending package support across all protocols\*\*, including gRPC, GraphQL, etc.
> \- \*\*Bringing this feature to Postman CLI and Monitors\*\* so your workflows stay consistent across all Postman tools.
> 
> Stay tuned! 💥
> 
> \## ⚠️ Known Limitations
> 
> While this is a huge leap forward, here are a few limitations to be aware of:
> \- Postman's script environment is platform-agnostic. This means Packages that rely on \[Node.js built-ins\](https://nodejs.org/api/modules.html#built-in-modules) like \`child\_process\` or \`worker\_threads\` may not work as expected. We offer best-effort implementations of Node built-ins, but they may not have complete parity with Node.js.
> \- Packages that reference globals outside the \[allowed sandbox environment\](https://learning.postman.com/docs/tests-and-scripts/write-scripts/postman-sandbox-api-reference/#use-global-objects) may not behave correctly, depending on the part of the package that is executed.
> \- Packages that use Top-level \`await\` are not supported at the moment.
> 
> \## 🙌 Thank You!
> 
> This was long overdue and wouldn’t have been possible without the incredible feedback and support from our Postman community. Your insights and use cases helped shape this—please keep it coming!
> 
> Happy Scripting!

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [April 14, 2025, 3:45pm UTC](https://community.postman.com/t/not-able-to-use-npm-package-in-postman/19372/9 "2025-04-14T15:45:37Z")

</div>

Closed on April 14, 2025, 3:45pm UTC


