
Security News
High Salaries No Longer Enough to Attract Top Cybersecurity Talent
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
@ngneat/falso
Advanced tools
@ngneat/falso is a JavaScript library that provides a wide range of fake data generators for various types of data. It is useful for testing, prototyping, and development purposes where you need to generate realistic but fake data.
Generate Fake Names
This feature allows you to generate random first and last names, which can be useful for populating user profiles or testing forms.
const { randFirstName, randLastName } = require('@ngneat/falso');
console.log(randFirstName()); // e.g., 'John'
console.log(randLastName()); // e.g., 'Doe'
Generate Fake Addresses
This feature allows you to generate random street addresses, cities, and countries, which can be useful for testing location-based applications.
const { randStreetAddress, randCity, randCountry } = require('@ngneat/falso');
console.log(randStreetAddress()); // e.g., '123 Main St'
console.log(randCity()); // e.g., 'New York'
console.log(randCountry()); // e.g., 'USA'
Generate Fake Dates
This feature allows you to generate random past and future dates, which can be useful for testing date-based functionalities.
const { randPastDate, randFutureDate } = require('@ngneat/falso');
console.log(randPastDate()); // e.g., '2020-01-01T00:00:00.000Z'
console.log(randFutureDate()); // e.g., '2025-01-01T00:00:00.000Z'
Generate Fake Emails
This feature allows you to generate random email addresses, which can be useful for testing email-related functionalities.
const { randEmail } = require('@ngneat/falso');
console.log(randEmail()); // e.g., 'john.doe@example.com'
Generate Fake Phone Numbers
This feature allows you to generate random phone numbers, which can be useful for testing contact forms and phone number validation.
const { randPhoneNumber } = require('@ngneat/falso');
console.log(randPhoneNumber()); // e.g., '(123) 456-7890'
Faker.js is a popular library for generating fake data. It offers a wide range of data types similar to @ngneat/falso, including names, addresses, dates, emails, and phone numbers. However, Faker.js has a larger community and more extensive documentation.
Chance.js is another library for generating random data. It provides a variety of data types and is highly customizable. Compared to @ngneat/falso, Chance.js offers more flexibility in generating complex data structures.
Casual is a library for generating random data with a focus on simplicity and ease of use. It offers a range of data types similar to @ngneat/falso but with a simpler API. Casual is a good choice for quick and easy data generation.
All the Fake Data for All Your Real Needs 🙂
Create massive amounts of fake data in the browser and NodeJS. Tree Shakeable & Fully Typed.
✅ 202 Functions
✅ Tree Shakable
✅ Fully Typed
✅ Factory Functions
✅ Entity Functions
✅ Single and Array Result
🤓 Learn about it on the docs site
npm i @ngneat/falso
yarn add @ngneat/falso
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.
const emails = randEmail({ length: 10, maxCharCount: 20 });
You can set your own seed if you want consistent results:
import { rand, seed } from '@ngneat/falso';
seed('some-constant-seed');
// Always returns 2
rand([1, 2, 3, 4, 5]);
// Reset random seed
seed();
npm run c
and choose the right answersFAQs
All the Fake Data for All Your Real Needs
The npm package @ngneat/falso receives a total of 366,031 weekly downloads. As such, @ngneat/falso popularity was classified as popular.
We found that @ngneat/falso demonstrated a healthy version release cadence and project activity because the last version was released less than 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
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.