# @liutsing/mock-extend

> A lib to extend mockjs Random's methods

Latest version **0.0.3** (published 2022-12-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install @liutsing/mock-extend
pnpm add @liutsing/mock-extend
yarn add @liutsing/mock-extend
bun add @liutsing/mock-extend
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2022-12-12 |
| First published | 2022-06-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | liutsing |
| Maintainers | liutsing-luo |
| Keywords | mockjs, extend methods |

## Links

- npm: https://www.npmjs.com/package/@liutsing/mock-extend
- Repository: https://github.com/Maple-Team/extend-mockjs-random
- Issues: https://github.com/Maple-Team/extend-mockjs-random/issues
- npm.io page: https://npm.io/package/@liutsing/mock-extend

## Dependencies (3)

- [mockjs](https://npm.io/package/mockjs.md) ^1.1.0
- [moment](https://npm.io/package/moment.md) ^2.29.3
- [snowflake-id](https://npm.io/package/snowflake-id.md) ^1.1.0

## Alternatives

- [pagerjs](https://npm.io/package/pagerjs.md) — 60 weekly downloads
- [whistle.savefor-mock](https://npm.io/package/whistle.savefor-mock.md) — 4 weekly downloads
- [react-component-mocker](https://npm.io/package/react-component-mocker.md) — 0 weekly downloads
- [pbmockx](https://npm.io/package/pbmockx.md) — 0 weekly downloads
- [chapterize-js](https://npm.io/package/chapterize-js.md) — 0 weekly downloads

## Recent versions

- 0.0.3 (latest) — 2022-12-12
- 0.0.2 — 2022-12-12
- 0.0.1 — 2022-06-28

## README

A lib to extend mockjs Random's methods

## usage

```js
import '@liutsing/mock-extend'
import { Random } from 'mockjs'

// then you can call extended method like Random.unix()
console.log(Random.unix())
```

## Resources

- [mockjs](https://github.com/nuysoft/Mock), mockjs github
- [@mockjs/core](https://npm.runkit.com/@mockjs/core/src/mock/random/address/address.ts?t=1655863119087), mockjs ts version

## test

### use `babel-test`

install dependences

```sh
pnpm install --save-dev babel-jest @babel/core @babel/preset-env
# for ts
pnpm install --save-dev @babel/preset-typescript
```

create babel config file

```js
module.exports = {
  presets: [
    ['@babel/preset-env', { targets: { node: 'current' } }],
    '@babel/preset-typescript', // ts
  ],
}
```

```js
// jest.config.ts
export default {
  transform: {
    '\\.[jt]sx?$': 'babel-jest',
  },
}
```

### use `ts-jest`

```js
// jest.config.ts
export default {
  transform: {
    '\\.[jt]sx?$': 'ts-jest',
  },
}
```

---
_Source: https://npm.io/package/@liutsing/mock-extend · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
