From 6be133a4f2fce059b407756c1ccaea61ed1e0eb6 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Thu, 28 Sep 2017 08:56:33 -0500 Subject: [PATCH] Add Require Additional JS Libraries In Postman as a mac til --- README.md | 3 ++- ...uire-additional-js-libraries-in-postman.md | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 mac/require-additional-js-libraries-in-postman.md diff --git a/README.md b/README.md index cb2b35a..779c807 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/). For a steady stream of TILs from a variety of rocketeers, checkout [til.hashrocket.com](https://til.hashrocket.com/). -_566 TILs and counting..._ +_567 TILs and counting..._ --- @@ -242,6 +242,7 @@ _566 TILs and counting..._ - [Display A Message With Alfred](mac/display-a-message-with-alfred.md) - [Insert A Non-Breaking Space Character](mac/insert-a-non-breaking-space-character.md) - [List All The Say Voices](mac/list-all-the-say-voices.md) +- [Require Additional JS Libraries In Postman](mac/require-additional-js-libraries-in-postman.md) - [Resizing Both Corners Of A Window](mac/resizing-both-corners-of-a-window.md) ### MySQL diff --git a/mac/require-additional-js-libraries-in-postman.md b/mac/require-additional-js-libraries-in-postman.md new file mode 100644 index 0000000..4279726 --- /dev/null +++ b/mac/require-additional-js-libraries-in-postman.md @@ -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).