Find the host’s cloud provider using Node.Js

If you ever wanted to inject or use cloud provider-specific code in the codebase or DevOps work, You can now do it very easily thanks to cloud-detect-js(https://github.com/vithalreddy/cloud-detect-js#readme) Node.js Module, which helps to determine host machine’s cloud provider using machine’s file system and metadata. Detect Host’s Cloud Provider This Module Provides a very simple API as … Read more

Inverse of pandas json_normalize or json_denormalize – python pandas

As we all know pandas “json_normalize” which works great in taking a JSON Data, however, nested it is and convert’s it to the usable pandas dataframe. pandas json_normalize documentation Now If you want the reverse operation which takes that same Dataframe and convert back to originals JSON format, for example: for pushing data to elastic … Read more

Installing Nix in WSL Ubuntu

If Try to install Nix package Manager on Window Subsystem for Linux or WSL, it throws some cryptic error messages, But There is work around for installing Nix On WSL Ubuntu or any other Distro. This Errors in WSL due to limited support to sandbox apis in WSL.   Steps to install Nix Package Manager … Read more

How to run shell script file or command using Nodejs?

nodejs npm

If you ever wanted to run some automation script or file in your Unix/Linux machine using nodejs? It may be to build your binaries from source code or for some tooling in your dev workflow. Nodejs Provides well-matured APIs for doing these operations and there are plenty of npm modules to ease the pain creating … Read more

Push and Pop Items Into MongoDB Array Via Mongoose in Node.js

mongoDB Monoogse Schema

How To Push or Pop Items Into MongoDB Document Array Via Mongoose in Node.js (Express.js)   If you’re Developing your Rest API’s using Node.js or Express.js, Then You’re probably using MongoDB as Database for Storing Data and Probably with mongoose ODM for working with MongoDB Database.Now as you’re DB starts to grow and you have multiple … Read more

How To Access the request object inside a GraphQL resolver Function (Apollo-Server-Express)

If you’re working with GraphQL (a query language for your API), and you’re using apollo-server-express, You may notice unlike express-graphql, request object will not be available in context, if it’s not defined in apollo-sever-express middleware, but don’t worry, if want request object available in context, just use following quick hack, not really and you’re done. normal apollo-server-express … Read more