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

@manalejandro/textbin2bintext

v1.0.0

Published

A CLI utility to convert text to binary and binary to text

Readme

@manalejandro/textbin2bintext

A versatile CLI utility and Node.js module for converting text to binary and binary to text. This package provides both programmatic and command-line interfaces for seamless text-binary conversions.

🚀 Features

  • Convert text to binary representation
  • Convert binary back to readable text
  • Command-line interface with intuitive commands
  • File input/output support
  • Short command aliases for quick usage
  • Comprehensive error handling
  • ESM (ES Modules) support

📦 Installation

Global Installation (CLI usage)

npm install -g @manalejandro/textbin2bintext

Local Installation (Programmatic usage)

npm install @manalejandro/textbin2bintext

🔧 CLI Usage

After global installation, you can use the textbin2bintext command:

Basic Commands

# Convert text to binary
textbin2bintext text2bin "Hello World"
textbin2bintext t2b "Hello World"

# Convert binary to text
textbin2bintext bin2text "0100100001100101011011000110110001101111"
textbin2bintext b2t "0100100001100101011011000110110001101111"

File Operations

# Read input from file
textbin2bintext text2bin -f input.txt

# Write output to file
textbin2bintext bin2text -f binary.txt -o output.txt

# Chain operations: read from file and write to another
textbin2bintext text2bin -f message.txt -o binary_output.txt

Help and Version

# Show help
textbin2bintext --help
textbin2bintext help

# Show version
textbin2bintext --version
textbin2bintext version

📚 Programmatic Usage

ES Modules (ESM)

import { textToBin, binToText } from '@manalejandro/textbin2bintext';

// Convert text to binary
const binaryResult = textToBin("Hello World");
console.log(binaryResult);
// Output: 0100100001100101011011000110110001101111...

// Convert binary to text
const textResult = binToText("0100100001100101011011000110110001101111");
console.log(textResult);
// Output: Hello

Default Export

import textbin2bintext from '@manalejandro/textbin2bintext';

const binary = textbin2bintext.textToBin("Hello");
const text = textbin2bintext.binToText("0100100001100101011011000110110001101111");

🎯 Command Reference

Commands

| Command | Alias | Description | |---------|-------|-------------| | text2bin | t2b | Convert text to binary | | bin2text | b2t | Convert binary to text | | help | -h, --help | Show help message | | version | -v, --version | Show version |

Options

| Option | Alias | Description | |--------|-------|-------------| | --file | -f | Read input from file | | --output | -o | Write output to file |

📖 Examples

CLI Examples

# Simple conversions
textbin2bintext t2b "Node.js"
textbin2bintext b2t "0100111001101111011001000110010100101110011010100111001100"

# Working with files
echo "Hello, World!" > message.txt
textbin2bintext text2bin -f message.txt -o message.bin
textbin2bintext bin2text -f message.bin

Programmatic Examples

import { textToBin, binToText } from '@manalejandro/textbin2bintext';

// Convert a message
const message = "JavaScript is awesome!";
const binary = textToBin(message);
console.log(`Binary: ${binary}`);

// Convert back
const originalMessage = binToText(binary);
console.log(`Original: ${originalMessage}`);

// Error handling
try {
    const result = binToText("invalid_binary");
} catch (error) {
    console.error("Conversion failed:", error.message);
}

🔍 API Reference

textToBin(text: string): string

Converts text to binary representation.

Parameters:

  • text (string): The text to convert to binary

Returns:

  • string: Binary representation of the input text

binToText(binary: string): string

Converts binary representation back to text.

Parameters:

  • binary (string): The binary string to convert to text

Returns:

  • string: Text representation of the input binary

🛠️ Development

Local Development

# Clone the repository
git clone <repository-url>
cd textbin2bintext

# Install dependencies
npm install

# Test the CLI locally
node cli.js text2bin "Test message"

Testing

# Test text to binary conversion
node cli.js t2b "Hello World"

# Test binary to text conversion
node cli.js b2t "0100100001100101011011000110110001101111"

# Test file operations
echo "Test content" > test.txt
node cli.js text2bin -f test.txt -o output.bin
node cli.js bin2text -f output.bin

📄 Dependencies

📝 License

MIT License - see the LICENSE file for details.

👤 Author

ale

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

📊 Keywords

text, binary, conversion, cli, command-line, utility, text2bin, bin2text, node.js, javascript


Made with ❤️ by ale