Socket
Book a DemoInstallSign in
Socket

netcalc-cli

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

netcalc-cli

Various IPv4 calucations from the command line.

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

js-standard-style

Table of Contents

Installation

Note: You need node.js installed on your PC.

npm install netcalc-cli -g

How to use

In your commandline enter the one of the following options:

Some things to consider

  • When commiting strings use double quotes.
  • >_ before the code shall symbolise your commandline input. Don't actually type these.
  • // are comments don't type these either.

Basics

>_ netcalc // shows usage and options
>_ netcalc -h // shows usage and options
>_ netcalc --help // shows usage and options
>_ netcalc - V // show version of netcalc-cli

IPv4 to binary

// Converts IPv4 to binary representation

>_ netcalc "192.168.150.1" -2
>_ netcalc "192.168.150.1" --ip-to-binary

// result ---> [ '11000000', '10101000', '10010110', '1' ]

Min and max address

// Calculate min (network) and max (broadcast) by IPv4 and CIDR

>_ netcalc "192.168.150.1" 24 -r
>_ netcalc "192.168.150.1" 24 --range

// result ---> ['192.168.150.0', '192.168.150.255']

Range of a network

// Calculates all IPv4s between and including the provided min and max addresses.

>_ netcalc "192.168.150.1" "192.168.150.254" -i
>_ netcalc "192.168.150.1" "192.168.150.254" --inner-range

// result ---> ['192.168.150.0', '192.168.150.1', '192.168.150.2', ..., '192.168.150.254', '192.168.150.255']

CIDR to netmask

// Converts CIDR to netmask

>_ netcalc 24 -c
>_ netcalc 24 --cidr-to-netmask

// result---> [255, 255, 255, 0]

FAQs

Package last updated on 06 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.