Basics

Some basics about vuub we need to get out of the way first.

Just like any other npm package, vuub has to be required in the script you plan to use it in. For example, if you want to use vuub in the index.js script you must require it like so:

const vuub = require('vuub')

That must be done in every script you want to use vuub in. While this method does work, it is not the recommended way to require vuub, nor is it the way we will be requiring vuub in this guide. Instead we will be doing so:

const { isEvenNumber, subtractStringArrays } = require('vuub')

This way, we are directly requiring the functions we want to use. This is not only going to be cleaner in your code, but it saves us some time from having to type vuub.something everytime we want to call vubb's functions. Don't forget to require vuub's function in this format in every script you want to use them in.

Vuub also has synchronous & asynchronous versions of each utility. Here is an example of requiring a synchronous & asynchronous version of the same utility:

const { isEvenNumber, isEvenNumberAsync } = require('vuub')

As you can see, we have the normal synchronous version of the utility called isEvenNumber and an asynchronous version called isNumberAsync. Usually, synchronous versions of utilities will be called by their function name, while asynchronous versions will have the word Async appended to the end.

With all that out of the way, you can now look at individual utilities in the guide. Have fun!

Last updated