khaosdoctor / percent-encode

Percent encode string following Twitter's spec from RFC 3986

Home Page:https://deno.land/x/percentencode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

percent-encode

Percent encode strings

This implementation is following Twitter's spec from RFC3986.

Disclaimer: This module is made to work with Deno alone, it won't work in Node environments.

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!

About

Percent encode string following Twitter's spec from RFC 3986

https://deno.land/x/percentencode

License:MIT License


Languages

Language:TypeScript 100.0%