npm.io
1.0.1 • Published 10 years ago

hexstringescaper

Licence
MIT
Version
1.0.1
Deps
0
Vulns
0
Weekly
0

Hex String Escaper

Escapes hex strings from "FF" format to "\xFF" hex equivalent. Useful for dynamically creating hex values (such as for a rgb value).

Install

npm install hexstringescaper

Usage

var util = require("util"),
	HexStringEscaper = require("hexstringescaper"),
	hEsc = HexStringEscaper.escaper;

console.log(hEsc["1F"]); // logs a non-readable symbol 

console.log(util.format("This is escaped hex: %s", hEsc["FF"]));
This is escaped hex: ÿ

Keywords