avatar

Andres Jaimes

Setting up node and typescript

This article describes the creation process of a node application with TypeScript. Installing nvm There are multiple ways to install node but we have picked the nvm path. This method will allow us to have multiple versions of node installed on the computer. We have to make sure that xcode command line tools are installed. We can trigger the installation by trying a command like cc on the terminal. Run the following command to install nvm:

Error handling for JS fetch requests

The following example handles server and connectivity errors for javascript fetch requests. function handleErrors(response) { if (!response.ok) throw new Error(response.status) return response } fetch('https://jsonplaceholder.typicode.com/todos/1') // handle network err/success .then(handleErrors) // use response of network on fetch Promise resolve .then(response => console.log("ok")) // handle fetch Promise error .catch(error => console.log('found an error: ', error)) handleErrors can be updated for handling different types of errors in different ways. This function is called whenever we get a response from the server (successful or failed).

Password Requirements Validation with JQuery

Password forms are challenging for users because we often ask them to enter complex strings which they are usually not allowed to see. Additionally, these strings have to meet different criteria – like having upper and lower case characters, numbers and so on – to keep our applications secure. In this post, we are going to add visual queues to a form that will allow users to get a better experience with passwords.