Skip to content

Commit

Permalink
Close #4, fixing package name to stream-to-async-iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
basicdays committed Feb 5, 2017
1 parent 0f06be4 commit bbedfd3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Stream Async Iterator
# Stream To Async Iterator


## Overview

`stream-async-iterator` provides a wrapper that implements `Symbol.asyncIterator`. This will allow streams to be usable
`stream-to-async-iterator` provides a wrapper that implements `Symbol.asyncIterator`. This will allow streams to be usable
as async iterables that can be used in for-await-of loops.

Supports node.js 4 and up.

## Installation

```
$ npm install stream-async-to-iterator
$ npm install stream-to-async-iterator
```

The examples provides use async/await syntax for for-of loops. This assumes you are in an environment that natively
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import {describe, it} from 'mocha';
import fs from 'fs';
import path from 'path';
import {expect} from 'chai';
import StreamAsyncToIterator from '../stream-async-to-iterator';
import S2A from '../stream-to-async-iterator';


describe('StreamAsyncToIterator', function() {
describe('StreamAsyncToIterator', () => {
const filePath = path.join(__dirname, 'lorem-ipsum.txt');

it('should iterate on a node stream', async () => {
const fileStream = fs.createReadStream(filePath, {encoding: 'utf8'});
const buff: Array<string> = [];

for await (const value of (new StreamAsyncToIterator(fileStream): StreamAsyncToIterator<string>)) {
for await (const value of (new S2A(fileStream): S2A<string>)) {
buff.push(value);
}

Expand All @@ -25,7 +25,7 @@ describe('StreamAsyncToIterator', function() {
const fileStream = fs.createReadStream(filePath, {encoding: 'utf8'});
const buff: Array<string> = [];

for await (const value of (new StreamAsyncToIterator(fileStream, {size: 16}): StreamAsyncToIterator<string>)) {
for await (const value of (new S2A(fileStream, {size: 16}): S2A<string>)) {
buff.push(value);
}

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "stream-async-to-iterator",
"name": "stream-to-async-iterator",
"version": "0.1.0",
"description": "ES async interator wrapper for node streams",
"main": "stream-async-iterator.js",
"main": "stream-to-async-iterator.js",
"scripts": {
"build": "make -j4 build",
"test": "make full-test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/basicdays/node-stream-async-iterator.git"
"url": "git+https://github.com/basicdays/node-stream-to-async-iterator.git"
},
"keywords": [
"node",
Expand All @@ -21,7 +21,7 @@
"author": "BasicDays <[email protected]> (https://www.basicdays.com)",
"license": "MIT",
"bugs": {
"url": "https://github.com/basicdays/node-stream-async-iterator/issues"
"url": "https://github.com/basicdays/node-stream-to-async-iterator/issues"
},
"devDependencies": {
"babel-cli": "^6.18.0",
Expand Down

0 comments on commit bbedfd3

Please sign in to comment.