@ngneat/falso
Version:
All the Fake Data for All Your Real Needs
114 lines (71 loc) ⢠3.67 kB
Markdown
<p align="center">
<img width="20%" height="20%" src="logo.png">
</p>
> All the Fake Data for All Your Real Needs š
Create massive amounts of fake data in the browser and NodeJS. Tree Shakeable & Fully Typed.
<hr />
<p align="center">
[](https://github.com/ngneat/falso/actions/workflows/ci.yml)
[]()
[]()
[](CODE_OF_CONDUCT.md)
[](https://github.com/semantic-release/semantic-release)
[](https://github.com/prettier/prettier)
</p>
ā
205 Functions
ā
Tree Shakable
ā
Fully Typed
ā
Factory Functions
ā
Entity Functions
ā
Single and Array Result
š¤ Learn about it on the [docs site](https://ngneat.github.io/falso/) <br>
[](https://github.com/sponsors/ngneat) aid in the continued development and maintenance of ngneat libraries. Consider asking your company to sponsor ngneat as its core to their business and application development.
Elevate your support by becoming a Gold Sponsor and have your logo prominently featured on our README in the top 5 repositories.
Boost your backing by becoming a Gold Sponsor and enjoy the spotlight with your logo prominently showcased in the top 3 repositories on our README.
<a href="https://houseofangular.io" target="_blank">
<img src="https://github.com/ngrx/platform/blob/main/projects/ngrx.io/src/assets/images/sponsors/house-of-angular.png" width="50px" height="50px" alt="House of Angular" />
</a>
Become a bronze sponsor and get your logo on our README on GitHub.
[](https://stackblitz.com/edit/typescript-pj5epp?file=index.ts)
```
npm i @ngneat/falso
yarn add @ngneat/falso
```
```ts
import { randEmail, randFullName } from '@ngneat/falso';
const user = { email: randEmail(), name: randFullName() };
const emails = randEmail({ length: 10 });
```
You can specify the length of elements you want to generate. Below is an example of generating 10 emails with length equal or smaller than 20 characters.
```ts
const emails = randEmail({ length: 10, maxCharCount: 20 });
```
You can set your own seed if you want consistent results:
```ts
import { rand, seed } from '@ngneat/falso';
seed('some-constant-seed');
// Always returns 2
rand([1, 2, 3, 4, 5]);
// Reset random seed
seed();
```
- Go over the steps in [this](https://github.com/firstcontributions/first-contributions) guide
- Add a new falso

- Use `npm run c` and choose the right answers
<div>Icons made by <a href="https://www.freepik.com" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>
Thanks to awesome contributors! ā¤ļø
<a href="https://github.com/ngneat/falso/graphs/contributors">
<img src="https://contrib.rocks/image?repo=ngneat/falso" />
</a>
Made with [contrib.rocks](https://contrib.rocks).