CIDR notation is a compact representation of an IP address and its associated network mask. The notation was invented by Phil Karn in the 1980s. CIDR notation specifies an IP address, a slash ('/') character, and a decimal number. The decimal number is the count of leading 1 bits in the network mask.
-- Wikipedia
Eventhough I am not a network guy but understandinbg these network concepts are fun. I wanted to develop a CIDR calculator app (Web, Mobile, and Desktop) and this is the start.
- Typescript
- Bitset
- Jest with ts-jest
npm i @simplyappdevs/cidr-calculator
- Clone repo:
git clone https://github.com/simplyappdevs/cidr-calculator.git - CWD:
cd cidr-calculator - Install deps:
npm i - Clear existing output:
npm run clean - Build module:
npm run build - Test:
npm test
Examples on how to use this module is available from https://github.com/simplyappdevs/cidr-calculator-example
You will need to run your application with
--es-module-specifier-resolution=nodeoption.Ex:
"exec": "node --es-module-specifier-resolution=node ./dist/index.js"for your NPM scriptnpm run exec.
Set type to module
"type": "module"
{
"name": "nodejs-prompt-example",
"version": "1.0.0",
"description": "My Awesome App",
"main": "index.js",
"type": "module",
"scripts": {
}
}Set module to one of ECMA script
"module": "esnext"incompilerOptionssection
{
"compilerOptions": {
"module": "esnext",
}
}Set module resolution to node
"moduleResolution": "node"incompilerOptionssection
{
"compilerOptions": {
"moduleResolution": "node",
}
}Brought to you by www.simplyappdevs.com (2021)