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

class-mock

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

class-mock

A mock library that allows you use decorators with classes to generate fake data. Based on faker.js library.

latest
Source
npmnpm
Version
0.1.10
Version published
Weekly downloads
4
300%
Maintainers
1
Weekly downloads
 
Created
Source

class-mock

A mock library that lets you use decorators with classes to generate fake data.

English | 简体中文

version @faker-js/faker license coverage gzip stars

Introduction

A mock library that lets you use decorators with classes to generate fake data. Based on @faker-js/faker

class-mock decorators essentially just stores metadata (configuration data) and does not modify the class.

Finally, when createMock(MockClass) is executed, all metadata (configuration data) of MockClass will be taken out, and then data generation will be performed with @faker-js/faker.

Supports any ts project or @babel/plugin-proposal-decorators (legacy is true) js project.

Installation

for npm

npm i class-mock @faker-js/faker

for yarn

yarn add class-mock @faker-js/faker

for pnpm

pnpm add class-mock @faker-js/faker

Usage

The usage is documented in the documentation.

Notice

ts project needs to be configured in tsconfig.json:

{
  "compilerOptions": {
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true
  }
}

Acknowledgement

Contributing

Learn about contribution here.

This project exists thanks to all the people who contribute:

License

MIT License © 2022-PRESENT yangjinming

Keywords

mock

FAQs

Package last updated on 26 May 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