Skip to content

Instantly share code, notes, and snippets.

name: Newman Test Run
on:
push:
branches:
- master
- staging
jobs:
newman:
runs-on: ubuntu-latest
steps:
@prashantagarwal
prashantagarwal / ReuseRequest.js
Last active February 16, 2024 19:20
Script to fetch and reuse a request from a different collection
function executeReferencedRequest({ collectionUId, requestUId, requestName, apiKey }, callback) {
var _ = require('lodash');
let message;
if (!apiKey) {
message = "Pleas generate an API key and add it in your collection level variables"
}
if (!collectionUId) {
message = "Please enter the UId of the collection from which you want to resuse a request or script"
@justmoon
justmoon / custom-error.js
Last active November 19, 2024 02:40 — forked from subfuzion/error.md
Creating custom Error classes in Node.js
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
this.extra = extra;
};
require('util').inherits(module.exports, Error);
@domenic
domenic / portable-node.md
Created May 25, 2012 21:03
Tips for Writing Portable Node.js Code

Node.js core does its best to treat every platform equally. Even if most Node developers use OS X day to day, some use Windows, and most everyone deploys to Linux or Solaris. So it's important to keep your code portable between platforms, whether you're writing a library or an application.

Predictably, most cross-platform issues come from Windows. Things just work differently there! But if you're careful, and follow some simple best practices, your code can run just as well on Windows systems.

Paths and URLs

On Windows, paths are constructed with backslashes instead of forward slashes. So if you do your directory manipulation