How to import a library in postman 'tests'?

I am trying to import a library to print current working directory in Postman ‘tests’ section? If I try with the below code

let process = require('node:process');
current_dir = process.cwd()
console.log('Current directory: ' + current_dir);

I get

There was an error in evaluating the test script:  Error: Cannot find module 'node:process'

My second doubt is, how do we import a user define library file? (Use case, I would like declare JSON schema variables in one file and have that used in all Postman tests by importing this JSON schema file)

Thanks in advance for the responses.

The common trick for declaring a JavaScript library to Postman is to include it¡s whole JS code as a giant global variable. There are some blogs describing this technique:

Hope it helps,
Mariano Corral