You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
This library is a set of utilities created in javascript to solve some of the common problems. These are some of the functions I write over my own projects and put them here to be reused in different scenarios and projects
IMPORTANTE NOTE! This library is very much in the process of being developed, it can be changed completely to something different. For now it is only used to share common functions in my own projects. Suggestions are welcome.
installation
Just install the dependency and start using
npmi @vacom/vantageoryarnadd @vacom/vantage
How to import
After installing the dependency, just import the utility you need
import{guid}from"@vacom/vantage";
Utilities and Functions
Number Utilities
random
This function returns a random number based on the minimum and a maximum number
Sometimes it is necessary to validate what type of email provider the user is registering, there are situations where these providers are temporary. This function allows you to create a bad list of mail providers where the email that is entered by the user is validated
This function uses the previous function to convert an array of data in the correct format of csv and then automatically downloads the file with the correct information to the user's machine
import{downloadCSV}from"@vacom/vantage";//usage// this function uses convertArrayOfObjectsToCSV behind// args = { filename: "name.csv" }// data = [{name: "John", email: "john@mail.com"}]downloadCSV(args,data);//output return and downloads the file
Browser Utilities
refreshPage
This function refreshes the page, is useful for large changes, or when user logout