UNPKG

strman.base64decode

Version:

The [strman](https://github.com/dleitee/strman) method `base64decode` exported as a [Node.js](https://nodejs.org/) module.

34 lines (32 loc) 738 B
Object.defineProperty(exports, "__esModule", { value: true }); /** * @module base64decode * @description * Decodes data encoded with MIME base64 * ## Install * Install all functions of strman * ```sh * yarn add strman * ``` * or just the base64decode function * ```sh * yarn add strman.base64decode * ``` * ## Usage * ```javascript * import { base64decode } from 'strman' * // OR * import base64decode from 'strman.base64decode' * ``` * @param {String} value - The data to decode. * @example * base64Decode('c3RybWFu') * // => 'strman' * @returns {String} The base64 decoded data. */ exports.default = function (value) { return new Buffer(value, 'base64').toString(); }; module.exports = exports['default'];