惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
博客园 - 三生石上(FineUI控件)
爱范儿
爱范儿
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Hugging Face - Blog
Hugging Face - Blog
C
Check Point Blog
Engineering at Meta
Engineering at Meta
有赞技术团队
有赞技术团队
月光博客
月光博客
M
MIT News - Artificial intelligence
V
Visual Studio Blog
Stack Overflow Blog
Stack Overflow Blog
阮一峰的网络日志
阮一峰的网络日志
D
DataBreaches.Net
I
InfoQ
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
雷峰网
雷峰网

博客园 - _herbert

小程序拍证件并局部裁剪 信创-为什么ORACLE使用JDBC查询SYSDATE时,RS.getDate能获取到时间部分? linux宝塔面板使用API自动部署更新文件 JSON JAVA找出哪个类import了不存在的类 LocalDate,LocalDateTime,Date,日期串相互转换 PostMan加载三方JS 微信支付集成_JSAPI VUE中使用AXIOS包装API代理 spring中el表达式安全和扩展 Spring使用el表达式 springboot中File默认路径 Springboot启动时记录进程ID ORACLE解析游标生成JSON ORACLE游标序列化 AI教我一条SQL实现明细转树形结构 Springboot构建包使用BOOT-INF中的class覆盖依赖包中的class Maven 构建知识库 MAVEN构建分离依赖JAR JAVA实现读取最后几行日志 信创-ORACLE迁移到KingbaseV9 信创-ORACLE迁移到DM8 sql分组 group by rollup,cube,grouping sets,group_id,groupingId
PostMan内置对象
_herbert · 2025-12-31 · via 博客园 - _herbert

Import packages into your scripts

You can use the pm.require method to import packages from your team's Package Library or external package registries inside scripts in HTTP, gRPC, and GraphQL requests.

pm.require

The pm.require method accepts the name of a package. Declare the method as a variable if the package has functions or objects you want to call. If the package only has code or instances of the pm object, you don't need to declare the method as a variable.

Examples

Use the following format to import a package from the Package Library:

const variableName = pm.require('@team-domain/package-name');

variableName.functionName()

Use the following format to import an external package from a package registry:

// package imported from npm
const npmVariableName = pm.require('npm:package-name@version-number');

npmVariableName.functionName()

// package imported from jsr
const jsrVariableName = pm.require('jsr:package-name@version-number');

jsrVariableName.functionName()

Use global objects

Postman supports the following JavaScript objects globally in your scripts:

Use external libraries

The require method enables you to use the sandbox built-in library modules. To use a library, call the require method, pass the module name as a parameter, and assign the return object from the method to a variable:

require(moduleName:String):function

The supported libraries available for use in the sandbox include:

The following libraries are deprecated and no longer supported:

The following NodeJS modules are also available:

Postman doesn't support the following in the buffer module: isAscii, isUtf8, resolveObjectURL, transcode, and copyBytesFrom.