New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

pm-sandbox

Package Overview
Dependencies
Maintainers
6
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pm-sandbox

Sandbox for Postman Scripts to run in Node.js or browser

latest
Source
npmnpm
Version
5.2.3
Version published
Weekly downloads
27
Maintainers
6
Weekly downloads
 
Created
Source

Postman Sandbox Build Status codecov

Module that unifies execution of third-party JavaScript within Node.js and Browser.

This module is part of Postman Runtime Core and is not intended for independent use.

If you are looking to execute collections, you should bee using Newman

Usage

var Sandbox = require('postman-sandbox'),
    context;

Sandbox.createContext(function (err, ctx) {
    if (err) {
        return console.error(err);
    }

    ctx.execute(`// code here`, {}, {}, function (err) {
        if (err) {
            return console.error(err);
        }
        console.log('executed')
    });
});

Sandbox Environment

The following section outlines the API available inside sandbox scripts

pm

  • pm.test
  • pm.info
  • pm.vault
  • pm.globals
  • pm.cookies
  • pm.execution
  • pm.variables
  • pm.visualizer
  • pm.sendRequest
  • pm.environment
  • pm.iterationData
  • pm.collectionVariables

pre-request script specials

  • pm.request

test script specials

  • pm.request
  • pm.response

Events fired from Sandbox

  • pong
  • error
  • console
  • execution
  • execution.error
  • execution.error.*
  • execution.request.*
  • execution.result.*
  • execution.cookies.*
  • execution.skipRequest.*

Events responded to

  • ping
  • execute
  • execution.abort.*
  • execution.response.*
  • execution.cookies.*

Contributing

Debug in browser

To debug tests in Chrome's DevTools, start tests using npm run test-browser -- --debug and click DEBUG.

Keywords

contextify

FAQs

Package last updated on 16 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts