random-usercard
Version:
Get a random (and sometimes ridiculous) user card every time you call it.
69 lines (52 loc) • 1.71 kB
Markdown
# Random User Data
Retrieve one or more random users data.
## Features
- **Random selection:** Get one or more users randomly.
- **Easy-to-use Package:** Simple options object.
- **Native JSON import:** Uses modern import syntax supported in Node.js v20.6.0+.
## Usage
### Import the function
```js
import randomUser from "random-usercard";
```
### Get one random user
```js
const user = randomUser();
console.log(user);
```
### Get multiple random users
```js
const users = randomUser({ count: 3 });
console.log(users);
```
## Reference
| Parameter | Type | Description | Default |
|-----------|--------|---------------------------|---------|
| count | Number | Number of users to return | 1 |
- Returns a single user object if count is 1.
- Returns an array of user objects if count is greater than 1.
## Requirements
- Node.js v20.6.0 or newer (for native JSON import syntax)
## Example users
```json
[
{
"id": 9,
"imageURL": "image url here",
"name": "Arjun Mehra",
"bio": "Entrepreneur, foodie, likes ancient history"
},
]
```
## License
MIT © Sapnendra
```text
Copyright (c) 2025 Sapnendra
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
>>>>>>> 0c50ca2 (Initial commit: random-usercard package)