mifo
v0.0.2
Published
Micro formats encoder and decoder.
Downloads
4,655
Maintainers
Readme
mifo
Micro formats encoder and decoder.
If links in this document not avaiable, please access README on GitHub directly.
Description
In this package, we defined some self-describing text formats.
Table of Contents
Get Started
const mifo = require('mifo');
// Encode the string into base64 format with self-describing heading.
mifo.base64.encode('青青子衿');
// RETURN: Base64006Z2S6Z2S5a2Q6KG
¡
mifo.base64.decode('Base64006Z2S6Z2S5a2Q6KG');
// RETURN: 青青子衿
API
- string | null mifo.decode(string code)
Automatically judge the micro-format of code and decode it with corresponding method.
mifo offers two methods for each micro format:
- string mifo.<formatName>.encode(string text)
- string | null mifo.<formatName>.decode(string code)
Micro Formats
base64
- string mifo.base64.encode(string text)
- string | null mifo.base64.decode(string code)
urlencode
- string mifo.urlencode.encode(string text)
- string | null mifo.urlencode.decode(string code)