
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
A mock library that allows you use decorators with classes to generate fake data. Based on faker.js library.
A mock library that lets you use decorators with classes to generate fake data.
English | 简体中文
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.
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
The usage is documented in the documentation.
ts project needs to be configured in tsconfig.json:
{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}
}
Learn about contribution here.
This project exists thanks to all the people who contribute:
MIT License © 2022-PRESENT yangjinming
FAQs
A mock library that allows you use decorators with classes to generate fake data. Based on faker.js library.
The npm package class-mock receives a total of 2 weekly downloads. As such, class-mock popularity was classified as not popular.
We found that class-mock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.