Tag: Node.js
-
React: Call Child Functions from Parent Functional Component
In the dynamic world of React development, one question often leads to another, unfolding layers of complexity and elegance in code. Recently, a junior programmer on my team approached me with a seemingly straightforward query: “How can I call child functions from a parent functional component in React?” Another colleague quickly interjected, “You can’t do…
-
How to mock class constructor with parameters- Jest and TypeScript
Earlier I wrote How to Mock a TypeScript class or dependency using Jest, that is basically a how to auto mock the ES class or module when it comes to typescript. Since it happen to come up on google results, get to see what people search around the subject and “jest mock constructor with parameters…
-
How to setup a TypeScript project dev environments like a pro
There are many ways to set up a nice developing environment for typescript. Since I like simplicity and ease of work, let’s setup a TypeScript project that is minimal and easy to work with. Though, It doesn’t mean we need to stick to the defaults; this setup works out of the box, it is pretty…
-
How to deploy nodeJS app to production
Releasing javascript/typescript applications normally ends up with producing a huge artifact, the reason is obviously the node_modules. Here I am showing you how to deploy a NodeJS app to production with very small artifact and very efficient deploy time. node modules When you create a modern javascript / typescript project you are taking care of…
-
npm package json lock version lockfileVersion:1 or 2? All you need
Now that node.js LTS is change to v16 many team members and even domen cloud providers have not upgraded yet and are still on v12 or v14. Node.js 14 comes with npm version 6 now we are on version 8. The teams having problem with someone messing up the git repo updating npm package json…