Posts

TypeScript - String Enum for Checking Value Type

Ramda's Type Check

Ramda's type checking returns a string, but in order for this to be useful, one needs to know if the returned value matches your intended assertion.

R.type({}); //=> "Object"
R.type(1); //=> "Number"
R.type(false); //=> "Boolean"
R.type('s'); //=> "String"
R.type(null); //=> "Null"
R.type([]); //=> "Array"
R.type(/[A-z]/); //=> "RegExp"
R.type(() => {}); //=> "Function"
R.type(undefined); //=> "Undefined"
Categories: #typescript
Nodejs - Memory Intensive Promise Operations

Backpressure for Promises

When dealing with promises, the processing of long-running tasks is the commonly encountered scenario. However, some long-running task might also be performing memory intensive operations. To deal with running multiple operations at once, it is important to place a limit on the number of promises allowed to run at the same time as to not exhaust the Nodejs JavaScript heap.

Tags: #NodeJs