finki-main
main
|
Last change
on this file since 81bc7da was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago |
|
Initial commit
|
-
Property mode
set to
100644
|
|
File size:
1.2 KB
|
| Rev | Line | |
|---|
| [81bc7da] | 1 | # simple-concat [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
|
|---|
| 2 |
|
|---|
| 3 | [travis-image]: https://img.shields.io/travis/feross/simple-concat/master.svg
|
|---|
| 4 | [travis-url]: https://travis-ci.org/feross/simple-concat
|
|---|
| 5 | [npm-image]: https://img.shields.io/npm/v/simple-concat.svg
|
|---|
| 6 | [npm-url]: https://npmjs.org/package/simple-concat
|
|---|
| 7 | [downloads-image]: https://img.shields.io/npm/dm/simple-concat.svg
|
|---|
| 8 | [downloads-url]: https://npmjs.org/package/simple-concat
|
|---|
| 9 | [standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
|
|---|
| 10 | [standard-url]: https://standardjs.com
|
|---|
| 11 |
|
|---|
| 12 | ### Super-minimalist version of [`concat-stream`](https://github.com/maxogden/concat-stream). Less than 15 lines!
|
|---|
| 13 |
|
|---|
| 14 | ## install
|
|---|
| 15 |
|
|---|
| 16 | ```
|
|---|
| 17 | npm install simple-concat
|
|---|
| 18 | ```
|
|---|
| 19 |
|
|---|
| 20 | ## usage
|
|---|
| 21 |
|
|---|
| 22 | This example is longer than the implementation.
|
|---|
| 23 |
|
|---|
| 24 | ```js
|
|---|
| 25 | var s = new stream.PassThrough()
|
|---|
| 26 | concat(s, function (err, buf) {
|
|---|
| 27 | if (err) throw err
|
|---|
| 28 | console.error(buf)
|
|---|
| 29 | })
|
|---|
| 30 | s.write('abc')
|
|---|
| 31 | setTimeout(function () {
|
|---|
| 32 | s.write('123')
|
|---|
| 33 | }, 10)
|
|---|
| 34 | setTimeout(function () {
|
|---|
| 35 | s.write('456')
|
|---|
| 36 | }, 20)
|
|---|
| 37 | setTimeout(function () {
|
|---|
| 38 | s.end('789')
|
|---|
| 39 | }, 30)
|
|---|
| 40 | ```
|
|---|
| 41 |
|
|---|
| 42 | ## license
|
|---|
| 43 |
|
|---|
| 44 | MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.