1.0.1 • Published 3 years ago

@simplyappdevs/cidr-calculator v1.0.1

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
3 years ago

Classless Inter-Domain Routing (CIDR) Notation Calculator

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

Why?

Eventhough I am not a network guy but understandibg these network concepts are fun. So, I wanted a write a CIDR calculator app (Web, Mobile, and Desktop) and figured I started with a shared module that I can use.

Notable Stacks

  • Typescript
  • Bitset
  • Jest with ts-jest

Install

  • npm i @simplyappdevs/cidr-calculator

Manual Build

  • 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

Example

Examples on how to use this module is available from https://github.com/simplyappdevs/cidr-calculator-example

Reminder for ESM Application

npm exec command option

You will need to run your application with --es-module-specifier-resolution=node option.

Ex: "exec": "node --es-module-specifier-resolution=node ./dist/index.js" for your NPM script npm run exec.

Configure package.json

Set type to module "type": "module"

{
  "name": "nodejs-prompt-example",
  "version": "1.0.0",
  "description": "Example for @simplyappdevs/nodejs-prompt NPM package",
  "main": "index.js",
  "type": "module",
  "scripts": {
  }
}

Configure tsconfig.json

Set module to one of ECMA script "module": "esnext" in compilerOptions section

{
  "compilerOptions": {
    "module": "esnext",
  }
}

Set module resolution to node "moduleResolution": "node" in compilerOptions section

{
  "compilerOptions": {
    "moduleResolution": "node",
  }
}

Brought to you by www.simplyappdevs.com (2021)