Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashwanikumar04/gulp-postcol
This is gulp module to replace java script code in the postman collections
https://github.com/ashwanikumar04/gulp-postcol
Last synced: about 8 hours ago
JSON representation
This is gulp module to replace java script code in the postman collections
- Host: GitHub
- URL: https://github.com/ashwanikumar04/gulp-postcol
- Owner: ashwanikumar04
- License: mit
- Created: 2018-11-14T06:38:34.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-14T09:36:36.000Z (almost 6 years ago)
- Last Synced: 2024-11-01T23:05:46.263Z (6 days ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gulp-postcol
This is gulp module to replace java script code in the postman collections. Postman provides hooks for ```pre-request``` and ```test``` so that some java script code can be executed. This code can become huge with time and not following proper coding guidelines will be problematic. Using this gulp plugin, we can replace the java script code from a java script file.# Usage
```javascript
var modifyJson = require("gulp-postcol");
```Create a config object which has mapping for the api and hook.
```javascript
var config = {
"GetRepoToken": {
"test": "scripts/getTokenSetEnvironment.js"
}
}
``````javascript
gulp.task('json', function () {
var args = checkArgs();
gulp.src(['src/**/*.json'])
.pipe(modifyJson(config))
.pipe(gulp.dest('dist/'));
});```
# For a working use case, have a look at [this](https://github.com/ashwanikumar04/postman-collections-scripts)
# Reference
[gulp-jsonminify](https://github.com/tcarlsen/gulp-jsonminify)