Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Generate fake data.
An alternative to faker.js but with cjs or esm syntax
https://github.com/Marak/faker.js
npm i minifaker
faker.js is too big and it's not currently supporting tree shaking. https://github.com/Marak/faker.js/issues/785
Supporting ES6 modules for faker.js would need a big restructure change.
Right now, I just need a couple of functions and it's faster to create a new package mirroring functions without having to do a lot of refactoring. However, importing the entire package will take work and time, but at least I can start using it without having to finish it.
I also want to use Typescript and introduce new functions.
I will deprecate functions with better alternatives.
npm i nanoid
to generate string IDnpm i lorem-ipsum
to generate lorem wordsI've notice that faker locales have duplicate words :S.
I'll try fix the duplicates when importing locale files to reduce size as much as possible.
// You can either import minifaker completely or import the functions you need
import minifaker, { arrayElement } from 'minifaker'
// const minifaker = require('minifaker')
minifaker.number()
arrayElement(['one', 'two', 'three'])
import minifaker, { cityName, Gender } from 'minifaker'
import 'minifaker/dist/locales/en' // first import is set a default locale
import 'minifaker/dist/locales/fr'
minifaker.firstName({ gender: Gender.FEMALE }) // female name in english
cityName({ locale: 'fr' }) // french city name
Faker.js | Locales | Func |
---|---|---|
arrayElement | n/a | arrayElement |
number,float | n/a | number |
boolean | n/a | boolean |
uuid | n/a | use nanoid |
firstName | en,fr | firstName |
phoneNumber | en,fr,fr_CA | phoneNumber |
cityName | en,fr | cityName |
cityPrefix | en | cityPrefix |
citySufix | en | citySufix |
imageUrl | n/a | imageUrlFromPlaceIMG |
imageUrl | n/a | imageUrlFromPlaceholder |
lorem | n/a | use lorem-ipsum |
objectElement | n/a | objectElement |
n/a | n/a | array |
lastName | en,fr | lastName |
jobTitle | en | jobTitle |
jobArea | en | jobArea |
jobDescriptor | en | jobDescriptor |
jobType | en,fr | jobType |
FAQs
lightweight faker.js
The npm package minifaker receives a total of 24,425 weekly downloads. As such, minifaker popularity was classified as popular.
We found that minifaker demonstrated a not healthy version release cadence and project activity because the last version was released 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.