Welcome to my blog !

How to execute shell script file from Nodejs Application

September 21, 2021 ·  4 min read

Sometimes, We want to execute the shell or bash script files from nodejs code, This tutorial talks about how to run shell script files from a javascript code and commandline in nodejs application. Why we need to run shell script file from nodejs programm It is helpful to automate the server side tasks with running unix shell script from javascript program Batch job execution to send email or copy or delete or sync files between file systems....

Learn npm runtime configuration file| .npmrc file example

September 20, 2021 ·  4 min read

Did you observed nodejs project has sevaral rc dot files like .npmrc, .babelrc in a project In this tutorial, Learn about contents of npmrc with below things npmrc file create how to add registry and scoped multiple registries npm config set,get list npmrc authtoken configuration npmrc file location in windows How to create a npm runtime configuration npmrc sample file example parsing rc file in nodejs For example,We have different rc files in different applications...

Nodejs URL and domain validation with examples

September 19, 2021 ·  2 min read

This is an short tutorial on how to validate below things in Nodejs Application validate URI domain name validation validation on uri is to check valid url or not and Domain validation is to check url contains http or https and extension is presnt How check Domain url validation with http or https in nodejs Some times, We want to check abc.com is valid url or not nodejs provides valid-url npm package to validate...

How to write unit testing for Angular Service classes and httpclient dependencies Angular

September 18, 2021 ·  5 min read

In this tutorial, you learn how to unit test angular services with example test cases. It also includes following things How to Setup a unit test Angular service Unit test service functions Mock dependencies with jasmine library Assert expected and actual with karma library Unit testing is an testing an piece of code with run as expected. In my previous post, We discuss about complete tutorials on Angular service with examples...

Multiple ways to read local json file in Nodejs application

September 17, 2021 ·  3 min read

In this tutorial, multiple ways to read local json file in Nodejs application using required js fs module readFile Let’s declare an local json file in the nodejs project emp.json { "id": 1, "name": "John", "salary": 5000 } easy way to read local json file with require function in nodejs This is an simple and easy way to read using require function const json = require("./emp.json"); console.log(json); It directly reads file as an object from local file....

You'll get a notification every time a post gets published here.