Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

printable-string

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

printable-string

Convert non-printable chars in string into their printable form

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

printable-string

Convert non-printable chars in string into their printable form.

Installation

npm install printable-string --save

Usage

    var print = require(printable-string)
    console.log print("\x00 \t \v \u038b")     // -> \x00 \t \v \u038b
    console.log print("\x00 \t \v \u038b", {uppercase: true})     // -> \X00 \t \v \U038B

Prefix 0x will be used if the char code in ASCII range and the \u for the codes above 256.

Control codes will be converted to their literal expression as following:

    0x07 -> '\a'      // Bell
    0x08 -> '\b'      // Backspace
    0x09 -> '\t'      // Horizontal Tab
    0x0a -> '\n'      // Line feed
    0x0b -> '\v'      // Vertical Tab
    0x0c -> '\f'      // Form feed
    0x0c -> '\r'      // Carriage return

Keywords

FAQs

Package last updated on 15 Aug 2014

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc