0.0.2 • Published 6 years ago
mifo v0.0.2
mifo
Micro formats encoder and decoder.
If links in this document not avaiable, please access [README on GitHub](https://github.com/YounGoat/ecmascript.mifo/blob/master/README.md) 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)