https://github.com/cirolee/tiny-lorem
A library of modern JavaScript tool for generating mock data
https://github.com/cirolee/tiny-lorem
Last synced: 8 months ago
JSON representation
A library of modern JavaScript tool for generating mock data
- Host: GitHub
- URL: https://github.com/cirolee/tiny-lorem
- Owner: CiroLee
- License: mit
- Created: 2022-08-13T05:19:24.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-29T06:56:40.000Z (8 months ago)
- Last Synced: 2024-11-29T07:33:26.758Z (8 months ago)
- Language: TypeScript
- Homepage: https://ciro.club/tiny-lorem
- Size: 651 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-ZH.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
tiny-lorem
> 用于生成模拟数据的现代 JavaScript 工具库。拥有完善的类型提示。可用于浏览器环境和 node 环境。
[English](README.md) | 简体中文
[](https://codecov.io/gh/cirolee/tiny-lorem/branch/main)   
## 安装
pnpm
```shell
pnpm add tiny-lorem
```yarn
```shell
yarn install tiny-lorem
```npm
```shell
npm install tiny-lorem
```## 使用
ESM(ESModule)
```ts
import TinyLorem from 'tiny-lorem';
const lorem = new TinyLorem();lorem.texts.word(); // 汉
lorem.number.int(); // 123
```CJS(CommonJs)
```ts
const TinyLorem = require('tiny-lorem');
const lorem = new TinyLorem();lorem.texts.word(); // 汉
lorem.number.int(); // 123
```## API 文档
[文档](https://ciro.club/tiny-lorem)
## Inspired by
[Mockjs](https://github.com/nuysoft/Mock)
[faker-js](https://github.com/faker-js/faker)## LICENSE
[MIT](LICENSE)