npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@pact-foundation/grunt-pact

v4.3.0

Published

A grunt task to run pact easily

Downloads

27

Readme

Build Status npm npm npm

Grunt Pact

UPGRADE NOTICE

If you are using grunt-pact as a dependency in your project, please update it to @pact-foundation/grunt-pact.

A grunt task to run pact on node.

Getting Started

This plugin requires Grunt >=0.4.0 (works with 1.X)

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-pact --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-pact');

The "pact" task

Overview

In your project's Gruntfile, add a section named pact to the data object passed into grunt.initConfig().

grunt.initConfig({
  pact: {
    options: {
      // Grunt Pact Specific Options
      force: <Boolean>, // Continue if one of the pact files errors, defaults to 'false'
      logLevel: <String>, // Specify log level, either 'trace', 'debug', 'info', 'warn', 'error' or 'fatal', defaults to 'info'
      // Pact Specific Options Go Here
      port: <Number>, // Port number that the server runs on, defaults to 1234
      host: <String>, // Host on which to bind the server on, defaults to 'localhost'
      log: <String>, // File to log output on relative to current working directory, defaults to none
      ssl: <Boolean>, // Create a self-signed SSL cert to run the server over HTTPS, defaults to 'false'
      cors: <Boolean>, // Allow CORS OPTION requests to be accepted, defaults to 'false'
      dir: <String>, // Directory to write the pact contracts relative to the current working directory, defaults to none
      spec: <Number>, // The pact specification version to use when writing pact contracts, defaults to '1'
      consumer: <String>, // The name of the consumer to be written to the pact contracts, defaults to none
      provider: <String> // The name of the provider to be written to the pact contracts, defaults to none
    },
    your_target: {
      // Specify Pact configuration files here
      src:['mocks/**/*.pact.js']
    },
  },
});

Options

All pact-mock-service options are available to grunt-pact.

options.force

Type: Boolean Default value: false

While running through pact files, this will prevent grunt from stopping if an error occurs.

options.logLevel

Type: String Default value: 'info'

Sets the log level for Pact when running. Can be set to 'trace', 'debug', 'info', 'warn', 'error' or 'fatal'.

options.port

Type: Number Default value: 1234

Port number that the server runs on.

options.host

Type: String Default value: 'localhost'

Host on which to bind the server on. You probably don't need to use this.

options.log

Type: String Default value: ''

File to log output on relative to current working directory.

options.ssl

Type: Boolean Default value: false

Create a self-signed SSL cert to run the server over HTTPS.

options.cors

Type: Boolean Default value: false

Allow CORS OPTION requests to be accepted.

options.dir

Type: String Default value: ''

Directory to write the pact contracts relative to the current working directory.

options.spec

Type: Number Default value: 1

The pact specification version to use when writing pact contracts.

options.consumer

Type: String Default value: ''

The name of the consumer to be written to the pact contracts. This can be set via the API.

options.provider

Type: String Default value: '.'

The name of the provider to be written to the pact contracts. This can be set via the API.