Parse Exclusively Safe Integer From String
import{parseInteger}from"parseinteger";constnumber=parseInteger("42");console.log(`The answer is ${number}`);// The answer is 42try{constnumber=parseInteger("17.5");}catch(e){if(einstanceofTypeError){// Handle the TypeErrorconsole.log(e.message);}elseif(einstanceofRangeError){// Handle the RangeErrorconsole.log(e.message);}}This plugin is issued under the MIT license.