mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 07:08:01 +00:00
Add Require Additional JS Libraries In Postman as a mac til
This commit is contained in:
20
mac/require-additional-js-libraries-in-postman.md
Normal file
20
mac/require-additional-js-libraries-in-postman.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Require Additional JS Libraries In Postman
|
||||
|
||||
When writing pre-request scripts and test scripts as part of a Postman
|
||||
request, you aren't limited to vanilla JavaScript. There are a handful of
|
||||
libraries that can be required where needed.
|
||||
|
||||
This short list of available libraries includes `cherrio`, `lodash`, and
|
||||
`moment`.
|
||||
|
||||
To pull one of these into a particular script, use the standard `require`
|
||||
feature:
|
||||
|
||||
```javascript
|
||||
var moment = require('moment');
|
||||
|
||||
var now = moment();
|
||||
```
|
||||
|
||||
For a full list of what is available, check out [Postman's Sandbox API
|
||||
Reference](https://www.getpostman.com/docs/postman/scripts/postman_sandbox_api_reference).
|
||||
Reference in New Issue
Block a user