postman-json-chopper
Version:
Splits up large postman collection json file into folders and smaller files and merges them back together
19 lines (14 loc) • 638 B
text/typescript
import { split } from "./split";
const inFile = process.argv[2];
const outFile = process.argv[3];
const maxDepthArg = process.argv[4];
// Check if the number of arguments is less than expected
if (process.argv.length < 4) {
console.error("Please specify all command line arguments:");
console.error("split ./path/to/large_postman_collection.json ./path/to/postman_collection_with_refs.json [maxDepth]");
process.exit(1);
}
// If maxDepthArg is provided, parse it as a number. Otherwise, set it to undefined.
const maxDepth = maxDepthArg ? parseInt(maxDepthArg, 10) : undefined;
split(inFile, outFile, maxDepth)