Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

base64-stream

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base64-stream - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

6

package.json
{
"name" : "base64-stream",
"description" : "Contains new Node v0.10 style stream classes for encoding / decoding Base64 data",
"keywords" : ["Base64", "stream", "streaming", "piping"],
"description" : "Contains new Node.js v0.10 style stream classes for encoding / decoding Base64 data",
"keywords" : ["Base64", "stream", "streaming", "piping", "node", "node.js", "encode", "decode"],
"author" : "Ross Johnson <ross@mazira.com>",
"version" : "0.0.1",
"version" : "0.1.0",
"repository" : {

@@ -8,0 +8,0 @@ "type" : "git",

@@ -1,4 +0,46 @@

base64-stream
=============
# Introduction
Contains new Node v0.10 style stream classes for encoding / decoding Base64 data
While Node.js has built-in support for Base64 data, it does not come with the ability to encode / decode data in a stream.
This library contains a streaming Base64 encoder and a streaming Base64 decoder for use with Node.js. These streams are written using the new Node.js v0.10 [stream interfaces](http://nodejs.org/api/stream.html) and are well covered with unit tests.
# Installation
To install base64-stream
npm install base64-stream
# Requirements
This module currently requires Node v0.10. Support for Node v0.8 may be added in the future using the [readable-stream](https://github.com/isaacs/readable-stream) module.
# Usage
To use base64-stream
```javascript
var fs = require('fs');
var Base64Encode = require('base64-stream').Encode;
var Base64Decode = require('base64-stream').Decode;
var streamMailAttachment = function(req, res, next) {
var getAttachment(...);
attachmentStream.pipe(new Base64Encode()).pipe(res);
// would also work
// attachmentStream.pipe(Base64Encode()).pipe(res);
}
var uploadAttachment = function(req, res, next) {
var email = createEmail(...);
var stream = req.pipe(new Base64Encode());
email.streamAttachment(stream);
}
```
# Testing
To run the unit tests
npm test
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc