# netcalc-cli

> Various IPv4 calucations from the command line.

Latest version **0.0.4** (published 2015-08-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install netcalc-cli
pnpm add netcalc-cli
yarn add netcalc-cli
bun add netcalc-cli
```

Provides the command `netcalc`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2015-08-06 |
| First published | 2015-08-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Pascal Spiesz |
| Maintainers | slamcode |

## Links

- npm: https://www.npmjs.com/package/netcalc-cli
- Repository: https://github.com/slamcode/netcalc-cli
- Homepage: https://github.com/slamcode/netcalc-cli#readme
- Issues: https://github.com/slamcode/netcalc-cli/issues
- npm.io page: https://npm.io/package/netcalc-cli

## Dependencies (2)

- [netcalc](https://npm.io/package/netcalc.md) ~0.0.2
- [commander](https://npm.io/package/commander.md) ^2.8.1

## Recent versions

- 0.0.4 (latest) — 2015-08-06
- 0.0.3 — 2015-08-06
- 0.0.2 — 2015-08-06
- 0.0.1 — 2015-08-06

## README

[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [Installation](#installation)
- [How to use](#how-to-use)
    - [Some things to consider](#some-things-to-consider)
  - [Basics](#basics)
  - [IPv4 to binary](#ipv4-to-binary)
  - [Min and max address](#min-and-max-address)
  - [Range of a network](#range-of-a-network)
  - [CIDR to netmask](#cidr-to-netmask)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## 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]
```

---
_Source: https://npm.io/package/netcalc-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
