Gathering detailed insights and metrics for postman-collection-transformer
Gathering detailed insights and metrics for postman-collection-transformer
Gathering detailed insights and metrics for postman-collection-transformer
Gathering detailed insights and metrics for postman-collection-transformer
Perform rapid conversion and validation of JSON structure between Postman Collection Format v1 and v2.
npm install postman-collection-transformer
97.4
Supply Chain
100
Quality
81.7
Maintenance
100
Vulnerability
99.6
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
87 Stars
1,335 Commits
45 Forks
15 Watching
22 Branches
57 Contributors
Updated on 28 Oct 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-3.5%
105,530
Compared to previous day
Last week
-1.1%
629,398
Compared to previous week
Last month
5.3%
2,803,228
Compared to previous month
Last year
4.2%
31,997,446
Compared to previous year
5
28
Perform rapid conversion of JSON structure between Postman Collection Format v1 and v2.
The formats are documented at https://schema.postman.com
For CLI usage:
$ npm install -g postman-collection-transformer
As a library:
$ npm install --save postman-collection-transformer
The transformer provides a Command line API to convert collections.
Example:
$ postman-collection-transformer convert \
--input ./v1-collection.json \
--input-version 2.0.0 \
--output ./v2-collection.json \
--output-version 1.0.0 \
--pretty \
--overwrite
All options:
$ postman-collection-transformer convert -h
Usage: convert [options]
Convert Postman Collection from one format to another
Options:
-h, --help output usage information
-i, --input <path> path to the input postman collection file
-j, --input-version [version] the version of the input collection format standard (v1 or v2)
-o, --output <path> target file path where the converted collection will be written
-p, --output-version [version] required version to which the collection is needed to be converted to
-P, --pretty Pretty print the output
--retain-ids Retain the request and folder IDs during conversion (collection ID is always retained)
-w, --overwrite Overwrite the output file if it exists
If you'd rather use the transformer as a library:
1 var transformer = require('postman-collection-transformer'), 2 collection = require('./path/to/collection.json'), 3 inspect = require('util').inspect, 4 5 options = { 6 inputVersion: '1.0.0', 7 outputVersion: '2.0.0', 8 retainIds: true // the transformer strips request-ids etc by default. 9 }; 10 11 transformer.convert(collection, options, function (error, result) { 12 if (error) { 13 return console.error(error); 14 } 15 16 // result <== the converted collection as a raw Javascript object 17 console.log(inspect(result, {colors: true, depth: 10000})); 18 });
The transformer also allows you to convert individual requests (only supported when used as a library):
1 2 var transformer = require('postman-collection-transformer'), 3 4 objectToConvert = { /* A valid collection v1 Request or a collection v2 Item */ }, 5 6 options = { 7 inputVersion: '1.0.0', 8 outputVersion: '2.0.0', 9 retainIds: true // the transformer strips request-ids etc by default. 10 }; 11 12 transformer.convertSingle(objectToConvert, options, function (err, converted) { 13 console.log(converted); 14 });
You can convert individual responses too if needed:
1 2 var transformer = require('postman-collection-transformer'), 3 4 objectToConvert = { /* A v1 Response or a v2 Response */ }, 5 6 options = { 7 inputVersion: '1.0.0', 8 outputVersion: '2.0.0', 9 retainIds: true // the transformer strips request-ids etc by default. 10 }; 11 12 transformer.convertResponse(objectToConvert, options, function (err, converted) { 13 console.log(converted); 14 });
The transformer also provides a Command line API to normalize collections for full forward compatibility.
Example:
$ postman-collection-transformer normalize \
--input ./v1-collection.json \
--normalize-version 1.0.0 \
--output ./v1-norm-collection.json \
--pretty \
--overwrite
All options:
$ postman-collection-transformer normalize -h
Usage: normalize [options]
Normalizes a postman collection according to the provided version
Options:
-i, --input <path> Path to the collection JSON file to be normalized
-n, --normalize-version <version> The version to normalizers the provided collection on
-o, --output <path> Path to the target file, where the normalized collection will be written
-P, --pretty Pretty print the output
--retain-ids Retain the request and folder IDs during conversion (collection ID is always retained)
-w, --overwrite Overwrite the output file if it exists
-h, --help Output usage information
If you'd rather use the transformer as a library:
1 var transformer = require('postman-collection-transformer'), 2 collection = require('./path/to/collection.json'), 3 inspect = require('util').inspect, 4 5 options = { 6 normalizeVersion: '1.0.0', 7 mutate: false, // performs in-place normalization, false by default. 8 noDefaults: false, // when set to true, sensible defaults for missing properties are skipped. Default: false 9 prioritizeV2: false, // when set to true, v2 attributes are used as the source of truth for normalization. 10 retainEmptyValues: false, // when set to true, empty values are set to '', not removed. False by default. 11 retainIds: true // the transformer strips request-ids etc by default. 12 }; 13 14 transformer.normalize(collection, options, function (error, result) { 15 if (error) { 16 return console.error(error); 17 } 18 19 // result <== the converted collection as a raw Javascript object 20 console.log(inspect(result, {colors: true, depth: 10000})); 21 });
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 1/7 approved changesets -- score normalized to 1
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
18 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More