Skip to content

Repository files navigation

NPM version

parseInteger

Parse Exclusively Safe Integer From String

Example

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);}}

License

This plugin is issued under the MIT license.

About

Parse Exclusively Safe Integer From String

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages