With the Postman VS Code extension, you can import packages from your team's Package Library into scripts in your internal workspaces. You can also import packages from external packages registries, such and npm or JSR, into your scripts.
You can use the Package Library to store commonly used scripts and tests as packages in your Postman team. You can maintain scripts and tests in one location and reuse them in your internal workspaces. Your Postman teammates can also access and import packages from the Package Library. The Package Library supports JavaScript code.
To create a new package, do the following:
Open an HTTP request, collection, or folder.
Click the Scripts tab, and then select the Pre-request or Post-response tab.
Click Packages in the lower right of the code editor, then click Open package library.
Click New Package.
Enter the following:
Name - The name of the package. This is used in the import statement that adds the package to your scripts.
You can't use the name of a package that already exists or a package that was deleted. Also you can't change the name of a package later.
Summary - The summary of the package so your teammates understand what it does.
Code - Enter code in the package. Learn how to write code in a package.
Click Create.
Once you've created a package, you can write code in it and import the package into your pre-request and post-response scripts.
To learn more about using your team's Package Library in Postman, see Add internal scripts to the Package Library in Postman.
You can import public packages from external package registries into your scripts. Postman supports importing packages from npm and JSR registries in scripts. External packages are supported in HTTP requests in the VS Code extension. Private packages aren't supported in the VS Code extension.
To search and import an external package, do the following:
To learn more about importing packages from external registries, see Import packages from external registries in Postman.
Last modified: 2025/07/25