percent-encode

Percent encode strings

This implementation is following Twitter's spec from RFC3986.

Install

import { decode, encode } from 'https://deno.land/x/percentencode/mod.ts';

Usage

The lib provides two functions: encode and decode.

encode

Encode will take a string or a byte array and return a promise that will contain the percent-encoded string.

await encode('Hello World!'); // Hello%20World%21

decode

Decode will take a string and return a promise that will contain the percent-decoded string.

await decode('Hello%20World%21'); // Hello World!