npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

contool

v1.0.5

Published

Professional CLI base converter and bit inspector

Readme

contool

Professional CLI base converter and bit inspector with BigInt support, bitwise calculator, and interactive REPL.

Features

  • Base Conversion: Convert between binary, octal, decimal, and hexadecimal
  • BigInt Support: Handle arbitrarily large integers
  • Fraction Support: Convert floating-point numbers
  • Negative Numbers: 32-bit two's complement representation for binary/hex/octal
  • Auto-Detection: Automatically detect input base from format
  • Bit Inspector: View decimal, binary, and byte-grouped representations
  • Bitwise Calculator: Evaluate expressions with base prefixes (0x, 0b, 0o)
  • Interactive REPL: Explore conversions interactively
  • Streaming Input: Process multiple values from stdin
  • Table Output: Show all bases in a formatted table

Installation

npm install -g contool

Or for local development:

git clone <repo>
cd contool
npm install
npm run build
node dist/contool.js --help

Usage

Basic Conversion

# Convert to binary (default)
contool 42
# Output: 101010

# Convert to specific base
contool 42 --to hex
# Output: 2a

contool 0xff --to dec
# Output: 255

contool 0b1010 --to oct
# Output: 12

All Bases Table

contool --all 42
# Output:
# Decimal  42
# Binary   101010
# Octal    52
# Hex      2a

Bit Inspection

contool --bits 255
# Output:
# decimal: 255
# binary : 11111111
# bits   : 11111111

Negative Numbers

contool --all -1
# Output:
# Decimal  -1
# Binary   11111111111111111111111111111111
# Octal    37777777777
# Hex      ffffffff

Calculator Mode

contool calc "0xff & 0b1010"
# Output: 10

contool calc "0x10 | 0b0010"
# Output: 18

Interactive REPL

contool -i
# contool> 42
# Decimal  42
# Binary   101010
# Octal    52
# Hex      2a
# contool> exit

Streaming Input

echo -e "10\n20\n30" | contool
# Output:
# 1010
# 10100
# 11110

echo "255" | contool --to hex
# Output: ff

Base Specification

# Convert from hex to binary
contool ff --from hex --to bin
# Output: 11111111

# Use named bases
contool 42 --from decimal --to binary
# Output: 101010

Supported Bases

  • bin/binary: Base 2
  • oct/octal: Base 8
  • dec/decimal: Base 10
  • hex: Base 16

Prefixes

  • 0b: Binary (e.g., 0b1010)
  • 0o: Octal (e.g., 0o755)
  • 0x: Hexadecimal (e.g., 0xff)

Examples

# Large numbers
contool 9007199254740991 --to hex
# Output: 1fffffffffffff

# Fractions
contool 0.5 --to bin
# Output: 0.1

# Complex expressions
contool calc "(0xff << 8) | 0x42"
# Output: 65314

Development

npm test          # Run tests
npm run build     # Build for distribution

License

MIT