Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cirolee/tiny-lorem

A library of modern JavaScript tool for generating mock data
https://github.com/cirolee/tiny-lorem

Last synced: about 1 month ago
JSON representation

A library of modern JavaScript tool for generating mock data

Awesome Lists containing this project

README

        


logo

tiny-lorem


> 用于生成模拟数据的现代 JavaScript 工具库。拥有完善的类型提示。可用于浏览器环境和 node 环境。

[English](README.md) | 简体中文

[![codecov](https://codecov.io/gh/cirolee/tiny-lorem/branch/main/graph/badge.svg)](https://codecov.io/gh/cirolee/tiny-lorem/branch/main) ![npm bundle size](https://img.shields.io/bundlephobia/min/tiny-lorem) ![npm](https://img.shields.io/npm/v/tiny-lorem) ![NPM](https://img.shields.io/npm/l/tiny-lorem)

## 安装

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)