Debugging webdriverio tests with VSCode

Debugging tests with webdriverio can get frustrating when you’re trying to figure out why your test is sometimes clicking the wrong elements or just plain not working. Am I using the correct selector? Which element is it actually clicking on? There’s 3 things that you can do to help you drill down:adding many console.log statements to your testusing a debugger to step through the test one line at a timeusing webdriverio’s `browser.debug()` to get an interactive js…

Continue Reading

Does any harm? #typescript

Why not to use “any” anywhere.Photo by Isaac Benhesed on Unsplash edited by Kunal PanchalTypeScript is a superset of JavaScript which primarily provides optional static typing, classes, and interfaces. Many of us JS maniacs love typescript as its strongly typed. The State of Javascript survey states that more than 46% of users have Used it, would use again. Typescript is the 4th Most Loved, Dreaded, and Wanted Languages according to StackOverflow surveys 2018. Those are…

Continue Reading

Tech Stack 2019: Secured Binaries

Simple walkthrough of securing binaries.This is one of a number of articles that add incremental functionality to the frontend and backend applications developed in the article Tech Stack 2019: Core.The final result of this article is available from the binary branch of the tech-stack-2019-backend repository.MotivationHaving just finished writing another article in this series on authentication and securing an API, my thoughts turned to how to secure binaries, e.g., say we wanted to only serve up…

Continue Reading

Streaming Images & Videos to Google Cloud Storage with Node.js, Express, and Multer ‍♂️

The Problem 😒I was tasked with transitioning code thats primary focus was to upload high-resolution images and large video files. It had to be highly reliable and more importantly, no longer live on AWS S3. I’m not going to get into the details of S3 vs. other storage providers, but I will say that Google’s infrastructure was extremely pleasing to work me when I chose to use Cloud Storage — a beautiful UI, amazing file explorer, and…

Continue Reading

Dive Into The Performance of mongoose-lean-virtuals — A Mongoose Plugin That Enables Virtuals in…

Dive Into The Performance of mongoose-lean-virtuals — A Mongoose Plugin That Enables Virtuals in Lean Mode.adopted from animals.sandiegozoo.orgIn Mongoose, lean is enabled by default to provide better performance. Despite the performance, we loss all useful Mongoose magic methods, getter and setter. A particular magic method which I leverage all the time is virtual . To make avail of virtual in lean mode, there is an official plugin — mongoose-lean-virtuals. Since lean mode is enabled to enhance performance, I wonder how…

Continue Reading

JavaScript Trends in 2019

One of the most popular traditions at the start of the new year is summarizing the past year and admitting its brightest moments. Today, we’ll take a look at the main JavaScript trends of 2018 and try to predict what will happen in 2019 just like we did last year. Let’s begin with a mass developers survey that will help us outline the current state of affairs in the world of web development.What Did…

Continue Reading

Yes I had to migrate 6 million records from DynamoDB to MongoDB

Image Ref : lynda.comWhy Migrate ?Before going into details some of you might wonder why on earth we need to migrate from DynamoDB to MongoDB in the first place, since both are well performing, stable and reliable NoSQL database engines. However both have their pros and cons based on the use case we have. In my case following are the highlighted features of MongoDB that lead me to make the decision to migrate.Powerful query engine (specially the…

Continue Reading

Authentication Made Easy with Auth0: Part 3

We wrap up this series by securing the application.This article is part of a series starting with Authentication Made Easy with Auth0: Part 1.Secure Application (Code)We secure the application (the SPA) using the Auth0.js library; in this particular case we use the CDN distribution. This simplified application behaves as follows:The application starts by redirecting the browser to Auth0After authorizing at Auth0, the browser is redirected back to the application with a hash appended to the URLThe application extracts…

Continue Reading

Authentication Made Easy with Auth0: Part 1

Through example, we will demonstrate how to use Auth0 to secure a Node.js (Express) API that is accessed by a single page application.In the past, I have used Passport to secure my Node.js APIs; not a lot of code, but was a bit tricky to setup correctly the first time. This approach also gets significantly more complex as we add additional authentication requirements, e.g., social integrations, etc.I have also used Firebase to build secured…

Continue Reading

Sending Mails with Sendgrid and Node.js

Essentially in every web application a need to send the user an email. ). In this article, I would love to show you how easy it is to setup Sendgrid and send emails easily to users. we would set up an easy module that would handle our mail sending.Installing SendGridFirstly, we need the official package for sending emails. Run the following command :npm install @sendgrid/mailNow we have the Sendgrid node package for the sending emails in…

Continue Reading

Framework-agnostic real-time CRUD libraries with Vue sample app

Three years ago, I released an open source boilerplate application as a proof of concept to demonstrate an approach to build real-time CRUD applications using RethinkDB, SocketCluster and Google’s Polymer framework. Although it received a lot of attention initially, that approach did not see any serious adoption and so I stopped thinking about it for a while.Recently, though, I’ve been feeling frustrated by the direction of progress in front end development and so I decided…

Continue Reading

The definitive guide to Express, the Node.js Web Application Framework

You can get a PDF, ePub and Mobi version of this page for an easier reference, or to read it on your Kindle or tablet.Table of ContentsInstallationHello WorldLearn the basics of Express by understanding the Hello World codeRequest parametersHow to retrieve the GET query string parametersHow to retrieve the POST query string parametersSending a responseHow to serve JSON dataManage cookiesWorking with HTTP headersRedirectsRoutingCORSTemplatingIntroduction to PugMiddlewareServing static filesSend filesSessionsValidating inputSanitizing inputHandling formsFile uploads in formsHow to create a self-signed HTTPS certificate for Node.js to…

Continue Reading

Sending Emails with the SendGrid Cosmic Function

We recently released Cosmic Functions (public beta). We’re excited to help teams build amazing modern products together with new serverless solutions.In this short tutorial, I’m going to show you how to get up and running with the SendGrid Email Function to send emails via SendGrid (to view more example functions login and go to Your Bucket > Settings > Functions).Deploying the Function1. Install the functionTo install the SendGrid function, go to Your Bucket > Settings…

Continue Reading

Microjob: a tiny multithreading library for Node.js

No more limits for CPU loadsTL;DR;Node.js 10.5 introduced worker threads and microjob is a tiny wrapper around them.microjob helps you to spawn new threads with ease, just like calling an anonymous function, interfaced with promises and async/await mechanism.A brief history of Node.jsNode.js is famous for its event loop, a powerful mechanism for handling I/O bound operations with high performance.The early implementations of the asynchronous interface were carried out with callbacks, then they evolved into promises and…

Continue Reading

What’s the CRP of your webpage?

Have you ever wondered why the Google search pages or Amazon site loads really fast? Well stay with me while I take you through the concept, implemented by the big giants, that drastically reduces Time to first byte, improves time to interactivity and page speed index. But firstly, let us go through some concepts that leads to the idea.Analysing Critical Rendering Path (CRP)First of all, let us define the vocabulary that we would be using frequently :->Critical…

Continue Reading

Worker Processes with Heroku By Example

A walk-through of adding a worker process to Heroku applications (written in TypeScript).Because JavaScript (TypeScript is transpiled to JavaScript) is single-threaded, we need to rely on separate processes (workers) to perform tasks that we do not want our web application to perform. A common example is offloading CPU-intensive operations.With Heroku applications, we run such processes in a containers called a dyno. To demonstrate their use, we will walk through setting up an application that…

Continue Reading

Handling File Uploads On Node Server Using Multer (Part A — Backend)

Part A: Server side code for handling file uploadsAccording to me, the best way of learning new technologies is to get a hands on experience simultaneously, and here in this coding tutorial article you will be learning how to make a drag and drop file upload form with node server.Please note that this is a two part tutorial article. → Handling Uploads Part-A: Let’s Make Backend! Handling Uploads Part-B: Let’s Make Frontend! (Coming Soon)You are currently…

Continue Reading

Why Hiring Full Stack Developers Becoming A Trend For Startups?

Full stack development-StartupsIn recent years, startups hires team of the full stack developers because they need to work with limited resources. Startups get the initial boost if the team can work on frontend and backend both for a web application or a product development.As a startup you can’t afford to hire a person for only one skill, you need a people who solves the multiple tasks. Rather hire for HTML developer only why not…

Continue Reading

TypeORM By Example: Part 7

Wrapping up series with many-to-many relationships.This article is part of a series starting with TypeORM By Example: Part 1.The final example for this article is available for download.Many-to-Many — DefineLet us say our todos can be categorized; a todo can be associated with any number of categories and categories can be used across multiple todos. We create:src / entity / Category.tshttps://medium.com/media/dc43a42796096b336b7867c58140025f/hrefand update:src / entity / Todo.tshttps://medium.com/media/78299e624f305329f9a9bec952f7a5db/hrefObservation:We have to identify one of the two entities, Category or Todo, as owning…

Continue Reading
Close Menu
Skip to toolbar