wiremock-standalone
v3.2.1
Published
WireMock standalone binary
Downloads
7,333
Readme
WireMock Standalone for NPM
This package downloads WireMock standalone from Maven Central and provides simple CLI wrapper for NPM.
How to use
npm i -D wiremock-standalone
# OR
pnpm add -D wiremock-standalone
# OR
yarn add -D wiremock-standaloneUsage (as script in package.json):
{
"scripts": {
"start:mock": "wiremock --root-dir ./mock"
}
}Downloader configuration
By default, the latest stable jre8 version of WireMock JAR is downloaded from public Maven repository.
You can override this behavior by:
- setting environment variables
- creating
.wiremockconfiguration file in your project (JSON format) - adding
wiremockproperty in yourpackage.json
| ENV | JSON | Default |
| --- | --- | --- |
| MAVEN_REPO_URL | mavenRepoURL | https://repo1.maven.org/maven2 |
| WIREMOCK_VERSION | version | resolved to the latest |
| JRE_VERSION | jreVersion | jre8 |
Runtime options
Java arguments
You can pass options to Java runtime with --java-arg CLI argument. All system properties are collected and appended to wiremock's --permitted-system-keys option.
wiremock --java-arg -Dmy.custom.var=some-value --root-dir ./mockHOWTOs
Passing ENV variables with env-cmd
yarn env-cmd -f [path/to/.env] yarn wiremock --global-response-templating --verbose --root-dir ./mocks --permitted-system-keys=WIREMOCK_.*Donation
If this project help you reduce time to develop, you can give me a cup of coffee :)
