Sometimes we might want to test a local developing module with another local project before merge and release the new version. Here’s the method we could achieve it: Step 1: in module project, execute npm pack: This will build a <package-name>-<version>.tar.gz file. Step 2: refer it in package.json of consumer project: Step 3: Install the package Ref: […]
Category: Basic
Everyday Types
Semantic Versioning
MAJOR.MINOR.PATCH Further: Refs: Semantic Versioning 2.0.0
All about Git
Basic Git cmd git init – initialises the current folder as a git repository git status – current status of the folder git add <file(s)/folder(s)> – commit the changes to the git repository git commit -m <“message”> git log <–oneline> – a brief log of commits git checkout <commit> <file> – checkout the file from […]
Testing in JS
What is “Testing”? We have expected result of our code, and testing is to make sure that the expectation is achieved, otherwise modification should be done. Instead of manually do it, we prefer to automate and simplify the process. Why Test? Get an error in case break code save time think about possible issues and […]
Data Structure and Algorithms 3
Sorting Algorithms Bubble sort From left to right, if the item is not in the right position, swap it with the right item; after each iteration, the next largest item bubbles up and moves to its correct position Time complexity: Selection sort In each pass, find the next smallest item and move it to the […]
Data Structure and Algorithms 2
Non-linear structures Tree A tree is a data structure that stores elements in a hierarchy. The elements are referred as nodes, and the lines connect them are edges. Each node has a value or an object. The top node in a tree is called root, and the nodes have no children are leaf nodes. Binary […]
Data Structure and Algorithms 1
Big O Notation Evaluate the performance of an algorithm (the worst case scenario) | Notation | Name | |—————|—————–| | O(1) | constant | | O(log(n)) | logarithmic | | O(n) | linear | | O(n^2) | quadratic | | O(n^c) | polynomial | | O(c^n) | exponential | Space Complexity Only calculate the additional […]