Work as a team · Lesson 20 of 20

Move from Postman

Bring collections, environments and scripts across, see what needs attention, and switch your CI from Newman to swc.

Beginner · 2 min · Updated

Paste a cURL command and get a saved request in a collection, ready to send.
Paste a cURL command and get a saved request in a collection, ready to send.

Most Postman collections work in Swastik Codes without changes, scripts included. This lesson shows how to move them and how to spot the few things that need attention.

Export from Postman

In Postman, export each collection (Export → Collection v2.1) and each environment, and the globals if you use them. A full data dump from Postman's account settings works too, as does a Git folder of Postman v3 collection files.

Import

  1. Click Import at the top of Swastik Codes.
  2. Drop the files (or a whole folder), paste a link, or paste the JSON as raw text.
  3. Check the preview and click Import.

Read the compatibility report

Before you import, Swastik Codes checks every script and request and shows how many requests should run unchanged. It lists anything that may not:

  • script calls it does not support, with the exact pm. member;
  • require() of modules the script sandbox does not include (lodash, moment, uuid, ajv, chai, cheerio, crypto-js and others are built in);
  • packages from Postman's package library that you have not added yet;
  • files attached from the original computer, which you need to pick again;
  • dynamic variables it does not generate, and variables no imported environment defines.

Download the report as text to work through it.

Your scripts keep working

Scripts use the same API: pm.test, pm.expect, pm.response, pm.environment, pm.sendRequest, pm.execution.setNextRequest and the rest work as they did. Swastik Codes also offers the same API as swc. (you can rename all of a collection's pm. calls from its menu, but you do not have to).

If you used Postman's package library, add the packages on the collection's Packages tab and pm.require('@team/helpers') works again.

Swap Newman for swc

swc run accepts Newman's flags: -e, -g, -d, -n, --folder, --env-var, --bail, --timeout-request and reporters cli, json, junit and html. In most pipelines you replace newman run with swc run and you are done. See Run your tests in CI with swc.

What is different

What you learned

  • Import Postman exports directly; the compatibility report tells you what needs attention.
  • pm. scripts and Newman flags keep working, so most teams switch in an afternoon.

You have finished the lessons. Open the app and try them on your own API, or browse every feature.

Try it on your own API

Swastik Codes runs in the browser and is free to use. Create an account to send requests, sync your workspaces and invite your team.