npm.io
1.0.1 • Published 5 years ago

ascer

Licence
MIT
Version
1.0.1
Deps
1
Size
3 kB
Vulns
0
Weekly
0

What is ascer?

Ascer is a npm module to easily access the https://randomuser.me API and help you make your code less cluttery (but tbh it is infact not very useful)

Installation

npm install ascer

Example

const {getRandomUser} = require('ascer');

( async () => {

    // Gets a random user and displays their first and last name
    const user = await getRandomUser();
    console.log(user.name.first + ' ' + user.name.last)

    // Gets a random male user and displays their first and last name
    // Gender options are 'male' and 'female'
    const maleUser = await getRandomUser({gender: 'male'});
    console.log(maleUser.name.first + ' ' + maleUser.name.last)

})();

Options

gender: 'male' | 'female'

This is a very useless module I only created for myself but feel free to use it if you need!

Keywords