How to use the @hapi/b64.Decoder function in @hapi/b64

To help you get started, we’ve selected a few @hapi/b64 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hapijs / pez / lib / index.js View on Github external
try {
            disposition = Content.disposition(this._headers['content-disposition']);
        }
        catch (err) {
            return this._abort(err);
        }

        if (disposition.filename !== undefined) {
            const stream = new Stream.PassThrough();
            const transferEncoding = this._headers['content-transfer-encoding'];

            if (transferEncoding &&
                transferEncoding.toLowerCase() === 'base64') {

                this._stream = new B64.Decoder();
                this._stream.pipe(stream);
            }
            else {
                this._stream = stream;
            }

            stream.name = disposition.name;
            stream.filename = disposition.filename;
            stream.headers = this._headers;
            this._headers = {};
            this._emit('part', stream);
        }
        else {
            this._name = disposition.name;
        }

@hapi/b64

Base64 streaming encoder and decoder

BSD-3-Clause
Latest version published 2 years ago

Package Health Score

74 / 100
Full package analysis