New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mocki

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocki

[![npm version](https://badge.fury.io/js/mocki.svg)](https://badge.fury.io/js/mocki) [![Coverage Status](https://coveralls.io/repos/github/adalyte/mocki/badge.svg?branch=develop)](https://coveralls.io/github/adalyte/mocki?branch=develop)

latest
Source
npmnpm
Version
0.3.3
Version published
Maintainers
1
Created
Source

Mocki

npm version Coverage Status

Mocki is a tool that lets you create Mock REST and GraphQL APIs.

Support for

  • Simulated failures
  • Simulated delays
  • Randomized reponses
  • Conditional resposes
  • Fake data generation

Getting Started

  • Install Mocki npm install -g mocki

  • Create a config YAML-file using the structure in .mocki/config.yml

    Hello world example:

     name: mocki
     port: 3000
     endpoints:
       - path: /hello
         method: get
           responses:
             - statusCode: 200
               body:
                 message: Hello from Mocki!
    
  • Start your mock by running mocki run --path ./path/to/config.yml

  • Test your mock by running curl http://localhost:3000

    { "message": "Hello World!" }
    

Prerequisites

We recommend using nvm to manage Node versions

  • npm > 6
  • node > 12

Documentation

Documentation is available at Mocki.io

Publishing a new version

  • Create tag from latest commit: git tag vX.Y.Z
  • Push tag: git push origin vX.Y.Z
  • Publish to npm: npm publish
  • Update coverage report: npm run coverage

FAQs

Package last updated on 08 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts