Nominal Pizza Masticator

    jorthix-get-mock-user
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.6 • Public • Published

    get-mock-user

    Get a complete user data or only parts with mock data provided from https://randomuser.me

    Examples

    🙋‍♀️ Get a user
    import { getFullUser } from 'jorthix-get-mock-user';
    import { User } from 'jorthix-get-mock-user/lib/interface/main';
    
    // Get a random user object
    getFullUser().then((user): User => {
        console.log('🥳', user)
    })
    🔊 Get a name
    import { getUserName } from 'jorthix-get-mock-user';
    
    // Get a random user name
    getUserName().then((name): string => {
        console.log('Hi 👋 ', name)
    })
    🌅 Get a photo
    import { getUserPhoto } from 'jorthix-get-mock-user';
    
    // Get a random user image
    getUserPhoto('medium').then((url): string => {
        console.log('Wow 📸 ', url)
    })
    📍 Get user location
    import { getUserLocation } from 'jorthix-get-mock-user';
    import { Location } from 'jorthix-get-mock-user/lib/interface/main';
    
    // Get a random user location
    getUserLocation().then((location): Location => {
        console.log('I am here 👉 ', location)
    })
    🎫 Get user login data
    import { getUserLogin } from 'jorthix-get-mock-user';
    import { Login, LoginShort } from 'jorthix-get-mock-user/lib/interface/main';
    
    // Get a random user login data
    getUserLogin().then((login): Login => {
        console.log('Login response ✅ ', login)
    })
    // Get a random user login data only username & password
    getUserLogin(true).then((userPass): LoginShort => {
        console.log('User 🥸 ', userPass)
    })

    Keywords

    Install

    npm i jorthix-get-mock-user

    DownloadsWeekly Downloads

    0

    Version

    1.0.6

    License

    ISC

    Unpacked Size

    11.5 kB

    Total Files

    8

    Last publish

    Collaborators

    • jorthix