This package has been deprecated

Author message:

this package has been deprecated

fack-json

1.0.0 • Public • Published

Purpose

This is a utility for mocking json data that pretends the api response data with JSON format.

Installation

npm install fake-json

How to use

import fakeJSON from 'fack-json'
 
const makeMock = fakeJSON(undefined, {
    summary: {
        reseedCollected: 9999,
        contributionCollected: 9999,
        totalCollected: 9999,
        reseedPayout: 9999,
        contributionPayout: 9999,
        totalPayout: 9999,
        beginningBalance: 20000
    }
})
 
const responseData = makeMock(10, (index, makePropValue) => {
                             return {
                                 "date"         : makePropValue('date', {startYear: 2018, endYear: 2018}),
                                 "reseedCollected": makePropValue('currency'),
                                 "contributionCollected": makePropValue('currency', {val: 100}),
                                 "totalCollected": makePropValue('currency', {min: 100000}),
                                 "reseedPayout": makePropValue('currency'),
                                 "contributionPayout": makePropValue('currency'),
                                 "totalPayout": makePropValue('currency'),
                                 "reseedBalance": makePropValue('currency'),
                                 "contributionBalance": makePropValue('currency'),
                                 "totalBalance": makePropValue('currency')
                             }
                         }
                     )
 

Readme

Keywords

none

Package Sidebar

Install

npm i fack-json

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • seven-lee