New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

qontract

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qontract - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

src/config.js

5

package.json
{
"name": "qontract",
"version": "0.0.1",
"version": "0.1.0",
"description": "npm wrapper for qontract",

@@ -34,4 +34,5 @@ "main": "src/index.js",

"download": "^8.0.0",
"exec-sh": "^0.3.4"
"exec-sh": "^0.3.4",
"yargs": "^15.4.1"
}
}

26

README.md

@@ -1,10 +0,6 @@

### NPM Wrapper for Qontract
[Qontract](https://qontract.run/) is a contract driven development tool that allows us to turn our contracts into executable specification.
## Installation
`npm install qontract`
`npm install qontract` will install the qontract locally to the node project.
will install the qontract locally in node_modules.
## Qontract in stub mode (For consumers)

@@ -20,3 +16,3 @@

`"qontract-stub": "./node_modules/.bin/start-qontract-stub *.qontract"`
`"qontract-stub": "./node_modules/.bin/qontract-stub --contractPath=*.qontract --host='localhost' --port='8000'"`

@@ -32,6 +28,22 @@ ## Qontract tests (For Providers)

`"qontract-tests": "./node_modules/.bin/run-qontract-tests *.qontract"`
`"qontract-tests": "./node_modules/.bin/qontract-test --contractPath=*.qontract"`
## API
### cli commands
`qontract-stub` run the qontract server in stub mode, used by consumers.
`qontract-test` run the qontract server in test mode, used by providers.
### cli arguments
`contractPath` path of the contract files. Can be aa wild card string.
`host` hostname to be stubbed out. Used in stub mode only.
`port` port to run the stub server. Used in stub mode only.
Check [Documentation](https://qontract.run/documentation.html) for more information

@@ -6,9 +6,11 @@ #!/usr/bin/env node

const path = require('path');
const jarPath = path.resolve('./node_modules/qontract/qontract.jar');
const [,,args] = process.argv;
const contractsPath = path.resolve(args);
const { qontractPath } = require('../config');
const jarPath = path.resolve(qontractPath);
const {argv} = require('yargs')
const contractPath = path.resolve(argv.contractPath);
console.log('running qontract tests')
execSh(
`java -jar ${jarPath} test ${contractsPath}`,
`java -jar ${jarPath} test ${contractPath}`,
{ },

@@ -15,0 +17,0 @@ err => {

@@ -6,9 +6,12 @@ #!/usr/bin/env node

const path = require('path');
const jarPath = path.resolve('./node_modules/qontract/qontract.jar');
const [,,args] = process.argv;
const contractsPath = path.resolve(args);
const { qontractPath } = require('../config');
const jarPath = path.resolve(qontractPath);
const {argv} = require('yargs');
const { contractPath, host, port} = argv;
const contracts = path.resolve(contractPath);
console.log('starting qontract stub server')
execSh(
`java -jar ${jarPath} stub ${contractsPath}`,
`java -jar ${jarPath} stub ${contracts} --host=${host} --port=${port}`,
{ },

@@ -15,0 +18,0 @@ err => {

const init = async () => {
const download = require('download');
const { qontractJarRemotePath } = require('./config');
console .log('Starting qontract jar download..')
await (async () => {
await download('https://github.com/qontract/qontract/releases/download/0.13.1/qontract.jar', '.');
await download(qontractJarRemotePath, '.');
})();

@@ -8,0 +9,0 @@ console .log('Finished qontract jar download!!')

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc