pax_global_header00006660000000000000000000000064125457720600014522gustar00rootroot0000000000000052 comment=5bf57ae03db720566538e799eecc0eeb5df0dd39 from2-string-master/000077500000000000000000000000001254577206000147105ustar00rootroot00000000000000from2-string-master/.gitignore000066400000000000000000000002441254577206000167000ustar00rootroot00000000000000# tmp files lib-cov *.seed *.log *.csv *.dat *.out *.pid *.gz # tmp folders pids/ logs/ results/ coverage/ # node.js node_modules/ npm-debug.log # osx .DS_Store from2-string-master/.travis.yml000066400000000000000000000002031254577206000170140ustar00rootroot00000000000000node_js: - "0.10" - "1" sudo: false language: node_js before_script: "npm i -g codecov.io" script: "npm run test-cov-ci | codecov" from2-string-master/LICENSE000066400000000000000000000020521254577206000157140ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2015 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.from2-string-master/README.md000066400000000000000000000034071254577206000161730ustar00rootroot00000000000000# from2-string [![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][coveralls-image]][coveralls-url] [![Downloads][downloads-image]][downloads-url] [![js-standard-style][standard-image]][standard-url] Create a stream from a string. Sugary wrapper around [from2](https://github.com/hughsk/from2). ## Installation ```bash $ npm install from2-string ``` ## Usage ```js const fromString = require('from2-string') fromString('hello world').pipe(process.stdout) ``` ## Why In order to use `from2` with strings, you must write some boilerplate to break the string in correctly sized chunks. This module handles that boilerplate for you, so you can directly source from a string. ## See Also - [from2](https://github.com/hughsk/from2) - Convenience wrapper for ReadableStream, with an API lifted from "from" and "through2" - [from2-array](https://github.com/binocarlos/from2-array) - Create a from2 stream based on an array of source values ## License [MIT](https://tldrlegal.com/license/mit-license) [npm-image]: https://img.shields.io/npm/v/from2-string.svg?style=flat-square [npm-url]: https://npmjs.org/package/from2-string [travis-image]: https://img.shields.io/travis/yoshuawuyts/from2-string.svg?style=flat-square [travis-url]: https://travis-ci.org/yoshuawuyts/from2-string [coveralls-image]: https://img.shields.io/coveralls/yoshuawuyts/from2-string.svg?style=flat-square [coveralls-url]: https://coveralls.io/r/yoshuawuyts/from2-string?branch=master [downloads-image]: http://img.shields.io/npm/dm/from2-string.svg?style=flat-square [downloads-url]: https://npmjs.org/package/from2-string [standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square [standard-url]: https://github.com/feross/standard from2-string-master/index.js000066400000000000000000000006271254577206000163620ustar00rootroot00000000000000const assert = require('assert') const from = require('from2') module.exports = fromString // create a stream from a string // str -> stream function fromString (string) { assert.equal(typeof string, 'string') return from(function (size, next) { if (string.length <= 0) return this.push(null) const chunk = string.slice(0, size) string = string.slice(size) next(null, chunk) }) } from2-string-master/package.json000066400000000000000000000013761254577206000172050ustar00rootroot00000000000000{ "name": "from2-string", "version": "1.1.0", "description": "Create a stream from a string. Sugary wrapper around from2", "main": "index.js", "scripts": { "test": "standard && NODE_ENV=test node test", "test-cov": "standard && NODE_ENV=test covert test", "test-cov-ci": "NODE_ENV=test covert -q --json test 2>&1" }, "repository": "yoshuawuyts/from2-string", "keywords": [ "stream", "string", "from", "source", "from2", "stream2", "streams2" ], "license": "MIT", "dependencies": { "from2": "^2.0.3" }, "devDependencies": { "concat-stream": "^1.4.8", "covert": "^1.0.1", "standard": "^4.5.2", "tape": "^4.0.0" }, "files": [ "LICENSE", "index.js", "README.md" ] } from2-string-master/test.js000066400000000000000000000005771254577206000162360ustar00rootroot00000000000000const concat = require('concat-stream') const test = require('tape') const fromString = require('./') test('should assert input types', function (t) { t.plan(1) t.throws(fromString, /string/) }) test('should create a stream from a string', function (t) { t.plan(1) fromString('hello world').pipe(concat(function (res) { t.equal(res.toString(), 'hello world') })) })