full-uri-escaper
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Full URI Escaper

This is a simple Node package to replace every character in a string with its URI-encoded equivalent. It can be used, for instance, to somewhat obfuscate query string parameters in a URI, for instance.

full-uri-escaper is designed to run both in the browser and in Node.

Usage Examples

Directly log escaped string

import fullURIEscaper from 'full-uri-escaper';

// Set `escaped` to
console.log( fullURIEscaper('Whatever you say, Mr. Boss-man!') );

Output:

%57%68%61%74%65%76%65%72%20%79%6f%75%20%73%61%79%2c%20%4d%72%2e%20%42%6f%73%73%2d%6d%61%6e%21

Get input from STDIN

import fullURIEscaper from 'full-uri-escaper';

// Request user input and set the STDIN to a variable so we can manipulate it
const stdin = fullURIEscaper.requestInput()

// End the STDIN on input, effectively only allowing one input
stdin.on('data', () => {  stdin.end()  });

Examples of STDOUT output:

EXAMPLE OUTPUT: "Enter a string to encode:"

EXAMPLE OUTPUT: Enter a string to encode:
Whatever you say, Mr. Boss-man!
%57%68%61%74%65%76%65%72%20%79%6f%75%20%73%61%79%2c%20%4d%72%2e%20%42%6f%73%73%2d%6d%61%6e%21

Enter a string to encode:

From Command Line

npx full-uri-escaper "Whatever you say, Mr. Boss-man!"
full-uri-escaper "Whatever you say, Mr. Boss-man!"

Examples of CLI output:

npx full-uri-escaper "Whatever you say, Mr. Boss-man!"
%57%68%61%74%65%76%65%72%20%79%6f%75%20%73%61%79%2c%20%4d%72%2e%20%42%6f%73%73%2d%6d%61%6e%21

Package Sidebar

Install

npm i full-uri-escaper

Weekly Downloads

3

Version

1.0.0

License

CC0

Unpacked Size

11.6 kB

Total Files

7

Last publish

Collaborators

  • bellcubedev