Eval and safe eval comparison with examples and stats.

snippet of safeEval code, https://github.com/hacksparrow/safe-eval/blob/master/index.js
snippet of safeEval code, https://github.com/hacksparrow/safe-eval/blob/master/index.js
Source github:https://github.com/hacksparrow/safe-eval/blob/master/index.js

Hi there, here I am sharing my learning from the performance optimization of a larger scale nodeJS application.

Here we are not going to argue should we use eval/safeEval or not, Here we will be seeing their performance comparison and security concerns, we will also see how safe eval is secure and it’s overheads, read this if you have made up your mind to use it.

A brief of what they are

Eval is used for the evaluation of the JS statements written in string format, and safe Eval does the same thing safely.

“Okay, so elaborate”

Sure, allow me.


Firebase web push notification with javascript.

This blog explains how to register with firebase and create a firebase service worker to receive the message even when web-app is not open in the browser,
using javascript.

Let’s start with the registration part

If you have already registered your app with firebase you can skip this part section and go to the next section Getting FCM credentials and VAPId key.

  1. After Login into firebase go-to console by clicking on the “go-to console button”
  2. Click on the add project.
  3. Now enter the project name and continue
  4. Here the analytics is checked by default, if you want to use Google analytics for your project leave it…

Ayush Chaurasia

Software Engineer (Full stack), Voracious Reader, and loves to solve problems.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store