{"_id":"@rauschma/stringio","_rev":"8-e2f4b8703803d924e0cc3f647168d1be","name":"@rauschma/stringio","dist-tags":{"latest":"1.4.0"},"versions":{"1.0.0":{"name":"@rauschma/stringio","version":"1.0.0","author":{"name":"Axel Rauschmayer"},"main":"./dist/src/index.js","types":"./dist/src/index.d.ts","scripts":{"build":"tsc","watch":"tsc --watch","test":"mocha --ui qunit","testall":"mocha --ui qunit dist/test","prepublishOnly":"tsc"},"//":"@types/node being a normal dependency is not ideal, but it ensures it’s installed automatically","dependencies":{"@types/node":"^9.4.7"},"devDependencies":{"@types/mocha":"^2.2.48","mocha":"^5.0.4"},"gitHead":"05208ce1363fef20beb99efbed90acab9974ad7f","description":"``` npm install @rauschma/stringio ```","_id":"@rauschma/stringio@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"10.0.0-nightly20180405b29c36b807","_npmUser":{"name":"rauschma","email":"axel@rauschma.de"},"dist":{"integrity":"sha512-SWzVSd84ssImYWoUoju958q9G5tzmTNigBZsXkJkQgLI1xY0LG6vkp2V5G9etYDVdUG5UVLs7s1L0CRpe31CrA==","shasum":"08b1e0ea0341e90b10881a62147aa0c9197fe51b","tarball":"https://registry.npmjs.org/@rauschma/stringio/-/stringio-1.0.0.tgz","fileCount":10,"unpackedSize":8176,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBU2BK9aMPLWAnIAZzE+F3GsNsGkmYyLqdzCmG6CD6owIhAObb19kLrtn9p/gyG4DC2DWb0z0nsQO0BCSrg/T0xfZy"}]},"maintainers":[{"name":"rauschma","email":"axel@rauschma.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stringio_1.0.0_1523047963373_0.9258556252846943"},"_hasShrinkwrap":false},"1.1.0":{"name":"@rauschma/stringio","version":"1.1.0","author":{"name":"Axel Rauschmayer"},"repository":{"type":"git","url":"git+https://github.com/rauschma/stringio.git"},"main":"./dist/src/index.js","types":"./dist/src/index.d.ts","scripts":{"build":"tsc","watch":"tsc --watch","test":"mocha --ui qunit","testall":"mocha --ui qunit dist/test","prepublishOnly":"tsc"},"//":"@types/node being a normal dependency is not ideal, but it ensures it’s installed automatically","dependencies":{"@types/node":"^9.4.7"},"devDependencies":{"@types/mocha":"^2.2.48","mocha":"^5.0.4"},"gitHead":"55e49d02fd43f9a1ea686426820a04da7149bf6a","description":"``` npm install @rauschma/stringio ```","bugs":{"url":"https://github.com/rauschma/stringio/issues"},"homepage":"https://github.com/rauschma/stringio#readme","_id":"@rauschma/stringio@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"10.0.0-nightly20180405b29c36b807","_npmUser":{"name":"rauschma","email":"axel@rauschma.de"},"dist":{"integrity":"sha512-xRXQtC1HU1kJAl/XaOxY6kE2qb3rJEc6BipPIuOha7/j49WGlZSiM2j+Gr8bMcHJdsZpXCMNDdw0cQtOT4uBvw==","shasum":"cba2608177ab9a55d5a7ec48dc2274320dbb425b","tarball":"https://registry.npmjs.org/@rauschma/stringio/-/stringio-1.1.0.tgz","fileCount":13,"unpackedSize":16903,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8H6OexaiaeIboNkrxcfL1tU7KMF//gjgVl8+bDblHzAIgdg5elFKGJS6HEqZ0KbXDApc5/W45Pl4bomDJW8cIz5U="}]},"maintainers":[{"name":"rauschma","email":"axel@rauschma.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stringio_1.1.0_1523117315311_0.7606476056889342"},"_hasShrinkwrap":false},"1.1.1":{"name":"@rauschma/stringio","version":"1.1.1","author":{"name":"Axel Rauschmayer"},"repository":{"type":"git","url":"git+https://github.com/rauschma/stringio.git"},"main":"./dist/src/index.js","types":"./dist/src/index.d.ts","scripts":{"build":"tsc","watch":"tsc --watch","test":"mocha --ui qunit","testall":"mocha --ui qunit dist/test","prepublishOnly":"tsc"},"//":"@types/node being a normal dependency is not ideal, but it ensures it’s installed automatically","dependencies":{"@types/node":"^9.4.7"},"devDependencies":{"@types/mocha":"^2.2.48","mocha":"^5.0.4"},"gitHead":"a80f79737f7fce9d50fa546d6a501bbc2c4b37ef","description":"``` npm install @rauschma/stringio ```","bugs":{"url":"https://github.com/rauschma/stringio/issues"},"homepage":"https://github.com/rauschma/stringio#readme","_id":"@rauschma/stringio@1.1.1","_npmVersion":"5.6.0","_nodeVersion":"10.0.0-nightly20180405b29c36b807","_npmUser":{"name":"rauschma","email":"axel@rauschma.de"},"dist":{"integrity":"sha512-6fHggYwg8T4Y4OZTiGv8YLAk9IUNO8bNOeL/iqVHp5bz8MNDegOd94tD/jfOpUB3zgiI1UrBDy1QDqpVRmTmgg==","shasum":"e52441b53e0023abdc70157fa35e53e3092cb2a5","tarball":"https://registry.npmjs.org/@rauschma/stringio/-/stringio-1.1.1.tgz","fileCount":13,"unpackedSize":17014,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWG9b1onUPInmcwdnBWsTsidZA9GRh+1N1wjdM9JOqeQIgSo+vZXmG7/Z1I5lOLPqbxiqRwew4rgQ1D3ItsWdques="}]},"maintainers":[{"name":"rauschma","email":"axel@rauschma.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stringio_1.1.1_1523123597129_0.5330753761080096"},"_hasShrinkwrap":false},"1.2.0":{"name":"@rauschma/stringio","version":"1.2.0","author":{"name":"Axel Rauschmayer"},"repository":{"type":"git","url":"git+https://github.com/rauschma/stringio.git"},"main":"./dist/src/index.js","types":"./dist/src/index.d.ts","scripts":{"build":"tsc","watch":"tsc --watch","test":"mocha --ui qunit","testall":"mocha --ui qunit dist/test","prepublishOnly":"tsc"},"//":"@types/node being a normal dependency is not ideal, but it ensures it’s installed automatically","dependencies":{"@types/node":"^9.4.7"},"devDependencies":{"@types/mocha":"^2.2.48","mocha":"^5.0.4"},"gitHead":"e7031479b48006a2d00e6267b06ce700a6b6df97","description":"``` npm install @rauschma/stringio ```","bugs":{"url":"https://github.com/rauschma/stringio/issues"},"homepage":"https://github.com/rauschma/stringio#readme","_id":"@rauschma/stringio@1.2.0","_npmVersion":"5.6.0","_nodeVersion":"10.0.0-nightly201804231c66a10a0c","_npmUser":{"name":"rauschma","email":"axel@rauschma.de"},"dist":{"integrity":"sha512-xoNUkAjndfFe82rEQtj3G4CnCPOk/PYUwt8xYssRK9VrnYNNHPtOv3PSUQhNxpNmUg2gKcUZnYSvjLUGMwupfQ==","shasum":"670212a913d047d88cb2a17e0f4630912aa3d2bb","tarball":"https://registry.npmjs.org/@rauschma/stringio/-/stringio-1.2.0.tgz","fileCount":16,"unpackedSize":18945,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3gt+CRA9TVsSAnZWagAA37EQAJ3XOabO2f1ZS2n0coly\nYHPfXexNgs8WikisEw+QwnN9fhi54FWPCrZD+1mzvhcaQWvYcTqea3CJbzUJ\n1mOfhDj9VTYL0gZgihd4OYwHf7xFKEav5SEs2iJqEXlu3ucLsa8jlcguq4uT\nQoztzp6PRCRobE8wNNp6skSKwU9oYOkmIGurmP72dmvoYbgP8E6zlDH8S1SC\nJmfG71/k/kEjdWqrbn49m+fKUQ+pgfEas7ATjEXc/qhtajV4f1/9O7RXtBKp\n4U8mDQnKxr7oy/BpmMbpdeHAVy1A2EJB/l8t1GAzm2SAViRYLoXlxYil42Qs\nu58707cddNotBUn/SYEwl1HT2r3F2YP3EhM8co1e4yf0nX3553zjgyiPWbYw\nDTCKv45GxMa0AFa5FrxTjEso2JpJdYoJNqyHafwADiaCefRBa4OaFCEmj9mG\ndt51o+nKOSi2VbsaaGabLyW6ZKDjsgGBvX7EQkX5feJBGWiiT0senSXXu1/U\nicAz8CxQd9HQ49wNTKgj4hGh7+ChrU0nm0NUMb6bzpWbieSttd/fsN55qmX5\ndQEArtSeTIziWcKch3gbHpJSSnv5wM4+XdjKHn7Dz+BHcNRU1NDiA9JnzKUl\nh/f02jOlgp2Gy/cnBXc5v77irkvuSgC/qQBK/zhM7xIoI6iwFvdkh9WJ29Nm\nhIzc\r\n=nayd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC43Q8KV5JwmIMnB+Ekbj++BWL+MqRRhdSR22AmqvF8JAIgBImV5b2A81jtdYrp2H2w4wXRCQpTHobvGgy3iqj9HK8="}]},"maintainers":[{"name":"rauschma","email":"axel@rauschma.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stringio_1.2.0_1524501373781_0.3380953214614797"},"_hasShrinkwrap":false},"1.2.1":{"name":"@rauschma/stringio","version":"1.2.1","author":{"name":"Axel Rauschmayer"},"repository":{"type":"git","url":"git+https://github.com/rauschma/stringio.git"},"main":"./dist/src/index.js","types":"./dist/src/index.d.ts","scripts":{"build":"tsc","watch":"tsc --watch","test":"mocha --ui qunit","testall":"mocha --ui qunit dist/test","prepublishOnly":"tsc"},"//":"@types/node being a normal dependency is not ideal, but it ensures it’s installed automatically","dependencies":{"@types/node":"^9.4.7"},"devDependencies":{"@types/mocha":"^2.2.48","mocha":"^5.0.4"},"gitHead":"e63c9a01390fa819f0eb9ed3f55ee3fba9e434d1","description":"``` npm install @rauschma/stringio ```","bugs":{"url":"https://github.com/rauschma/stringio/issues"},"homepage":"https://github.com/rauschma/stringio#readme","_id":"@rauschma/stringio@1.2.1","_npmVersion":"5.6.0","_nodeVersion":"10.0.0","_npmUser":{"name":"rauschma","email":"axel@rauschma.de"},"dist":{"integrity":"sha512-mw0LQ+UpR5cIbkYHJauDENBgRMsJzME6Ns+KsEwzdogpvOjAM6u5xEUdg6Q0CIjTliH4wJUowHg47StPuH49cQ==","shasum":"ebc6bde064032a463cd45aa83c2ceeb3c1fc5158","tarball":"https://registry.npmjs.org/@rauschma/stringio/-/stringio-1.2.1.tgz","fileCount":16,"unpackedSize":18838,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa58m8CRA9TVsSAnZWagAAsAoP+QEd/uPXD7XtpK5HJugF\nTLe+hcpeYbHmhETmRtd8tUKRg5Qy7GidAJgEADdeHl0E6Nsq69/UsVBKUzvD\nHx+kqOL0EbPMoI0zr1VvDeeUDvXGkj5VwD1cESIxUK9vbO1UpS4R9EC3jVZF\ndjDIfF8NOw5lp6rvCaBn9/ThaPJHRDBlb1b97WrTrSl25JaTAuXp5me33Jhm\nFtQmHkcdcjdeDI5qA3VHmq6zrFxC+sDl2/pgw48VdsVQsw+qPahgJ09WXZ6a\n82zEuW3icukaNBxIPCpsbey25t7YXPm6/yGDvcnmUA8rFyDZHcL3bn1XpQDr\nP2yDdBPEla+TQHJhynJb3nplQsjtZsXSWcHSokt0x2XnpIv6SzfxMacoCTy6\n3toy3ZOpYOhFG5hV61VKiT8HYYieM3SgqhlVwsvgCL4ShY6b2ELdNpMtRdtH\nD19Wet4KFdwQLqeMMNcCP862MgmoVRFSmrzPsSUtVOlzhTOLFKlxJXJcDDeZ\nFrcwAuwyUaIw/3hV2OOM7395l2mFxvYr3R/1h5hFFqHDRukHCqFUMDmaUpjB\npFj0pHfPHpDHad6GbHoBk8s/P7w+sgLsjU3BtlzdSlZSSOfAkKRg4FGTwugU\n2BHCBNOrP6gXmfAGyqaxAbjiCeNQxOaTY+CQCoQ7xSQPbdn9ciTlhIWrEHaR\nD8Tw\r\n=2yji\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBZQLZ3hakZAXo981pC36kHw0eyjWViLUPVeYm+wM8qpAiBeLOEXx43txw0Zxqg+752mbvBM9ut103jEXdAtEl77dA=="}]},"maintainers":[{"name":"rauschma","email":"axel@rauschma.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stringio_1.2.1_1525139900298_0.7407547801114158"},"_hasShrinkwrap":false},"1.3.0":{"name":"@rauschma/stringio","version":"1.3.0","author":{"name":"Axel Rauschmayer"},"repository":{"type":"git","url":"git+https://github.com/rauschma/stringio.git"},"main":"./dist/src/index.js","types":"./dist/src/index.d.ts","scripts":{"build":"tsc","watch":"tsc --watch","test":"mocha --ui qunit","testall":"mocha --ui qunit dist/test","prepublishOnly":"tsc"},"//":"@types/node being a normal dependency is not ideal, but it ensures it’s installed automatically","dependencies":{"@types/node":"^10.0.3"},"devDependencies":{"@types/mocha":"^2.2.48","mocha":"^5.0.4"},"gitHead":"3136377ddbaee6a9b8dbbb176cecb59be21ab25a","description":"``` npm install @rauschma/stringio ``` <!-- ########################################################## -->","bugs":{"url":"https://github.com/rauschma/stringio/issues"},"homepage":"https://github.com/rauschma/stringio#readme","_id":"@rauschma/stringio@1.3.0","_npmVersion":"5.6.0","_nodeVersion":"10.0.0","_npmUser":{"name":"rauschma","email":"axel@rauschma.de"},"dist":{"integrity":"sha512-TeNyVmXUtP760qDqs/TVTHkxRTjM6d9InwTjJm96h2nC9CJ+/uTuIy8LqwJ+5S8/ebpCjBVKrPaf5ASb8iw+Tw==","shasum":"633a48c3b0bab77bd005d8196f31ec2173e7edf9","tarball":"https://registry.npmjs.org/@rauschma/stringio/-/stringio-1.3.0.tgz","fileCount":16,"unpackedSize":22022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa7NO1CRA9TVsSAnZWagAAHVcP/0o2puyZFiIgkUySECDI\nCRwPmAcKxxb4ClCn5zQwvohQUkXDScdnhNe/qumbabojNOhFlGiH7VccIVRV\nHci3n83O1uocvBhAHWmtlz90MJm0DQOnnx0Vb8tWAgo4IsvJMImO6ATawO6t\nI/A2ZJcLV2PH+IVbEE3q1ZxYF0FHlkMUCxVW13EimFpZHfnHeQxYbdyI5ZA0\no5lfybJ5eoStMrkmDdrc5LLoJEvPJxtwO8VglIgvrp9gMQNhFEzkuiQPgrUx\nPZombFo/5Om8EqqVadiUAUKRPiURMTG+7jYOGVoagNdhaMzx3FBPYt4gwJFv\nUKpMoEr6TSwTzKhwArLvtL9TkGyTznHZtR4abGkqv0oLCCH5p46oz4x+sPPN\nA2Uaw09CSu4ZqjALyslmFwq97usFT6aEcXYROUXx1miHbjhOUbyOz4sAJq94\nrT64bHaNILnEH3Uc7C5C1IMSp36gR24XYSrF8pCQOMn4cKeH93hj+oCbVXRA\ndueWGH1p9enMVgPmEKsQ89wxtkA14wWYeJPC1KwQrOd/x5uDiNUebmzZppkl\nsndwDSET4rOCWtBg1BmpGzGOsw1WK6QPf+9JcVXgWh6hsaap+4m7iv5awxQ9\nf3Rljl+yy37qCxJbvWBkx8LF7rLcDJgNbOVZ+r+69hRZZncR90XqEF8mCwBm\nifrF\r\n=F7hs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDwZy/piCGAFtJm+tGg8G+h281fFuaEfsjfOlqIxR3nqAiEA6sK0naWWm0HMZYumHe9h2XKmr7slB13sldmm9jox9pY="}]},"maintainers":[{"name":"rauschma","email":"axel@rauschma.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stringio_1.3.0_1525470132342_0.46181599591213507"},"_hasShrinkwrap":false},"1.4.0":{"name":"@rauschma/stringio","version":"1.4.0","author":{"name":"Axel Rauschmayer"},"repository":{"type":"git","url":"git+https://github.com/rauschma/stringio.git"},"main":"./dist/src/index.js","types":"./dist/src/index.d.ts","scripts":{"clean":"rm -rf dist/*","build":"tsc","watch":"tsc --watch","test":"mocha --ui qunit","testall":"mocha --ui qunit dist/test","prepublishOnly":"tsc"},"//":"@types/node being a normal dependency is not ideal, but it ensures it’s installed automatically","dependencies":{"@types/node":"^10.0.3"},"devDependencies":{"@types/mocha":"^2.2.48","mocha":"^5.0.4"},"gitHead":"b55d60f41c6ba7cc692930dbc1039e67da52968b","description":"``` npm install @rauschma/stringio ``` <!-- ########################################################## -->","bugs":{"url":"https://github.com/rauschma/stringio/issues"},"homepage":"https://github.com/rauschma/stringio#readme","_id":"@rauschma/stringio@1.4.0","_npmVersion":"5.6.0","_nodeVersion":"10.0.0","_npmUser":{"name":"rauschma","email":"axel@rauschma.de"},"dist":{"integrity":"sha512-3uor2f/MXZkmX5RJf8r+OC3WvZVzpSme0yyL0rQDPEnatE02qRcqwEwnsgpgriEck0S/n4vWtUd6tTtrJwk45Q==","shasum":"0b667bea726652a10a48dfc1dadc89e0ec51e269","tarball":"https://registry.npmjs.org/@rauschma/stringio/-/stringio-1.4.0.tgz","fileCount":16,"unpackedSize":23735,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa7RLGCRA9TVsSAnZWagAAH9wP/1XW2lIq1ZOmJdmPru8r\njVgBk4fbL6SsNB8Tw3vWVeF2jNt1nSZ44PCI8pJ9iOU4bRz/ZFUtZbQwCW6D\nPv+aazwKmYqUVuMTOhOJZo15NEEm5S4/oSJfZWn73/3UMmFh4jqDRg3iLl4O\nT/GHaEdO8iqf6n9moydGpVDV6TAous7+skkjEHN1C75BQz2Kr97k3fCUosWZ\nd8G7cog88khKxOHeEipZWWo6GRGa7qHYObMeaPKwYG+luS3DU+GPCy3PZ58u\n1MHbcH4g23awQuR7ngg8zcJx1Ai6dO16LyGxRTFgDAeTbl5MAo58KogEQ1yD\nmlsxnbCawhDau1/Ka0TjOlboyqjvtiYzKJF6sGN3DD2SkY1qGfkIV+Qv+5dV\nHiL91xsIxcxZilWTC0hqyPXOcnCMI5Zakmn/vpsAb1PshjUjZVCmeT9C3ant\nphAkViGJa19zhlgk/OnblxPDY3pEnV9JyDHjU+PvW9UUIGU4ge9kShvEjcUW\niX5Gqgo0vWLiIJ71P34TD52Tm/GTUKdC6bqA8lUyeN7AG2w8OrbMUHsK2e/Y\n+O/WdEHTZ4h55UEky2nwz0yxwNXLEPqlC/X9S+rorJUCRAojj2CAHKUmcOh6\n1Zm49nbObuqrDdlHYokECBC9ndbqIbzv28v8Un9NxCM/j3uxWYOYgnuKZ48/\n1NZx\r\n=/cA4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC3+DjAi/qqDHJVTaDpGCY3NoG2gnQUy09LYKVIt1x8rAiEA3bBriMzH6v2HlduEor5jWiwp1mVpnf4I7cwQCEXgk0I="}]},"maintainers":[{"name":"rauschma","email":"axel@rauschma.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stringio_1.4.0_1525486277868_0.3131167001044044"},"_hasShrinkwrap":false}},"time":{"created":"2018-04-06T20:52:43.323Z","1.0.0":"2018-04-06T20:52:43.444Z","modified":"2022-04-06T18:09:29.324Z","1.1.0":"2018-04-07T16:08:35.386Z","1.1.1":"2018-04-07T17:53:17.180Z","1.2.0":"2018-04-23T16:36:13.867Z","1.2.1":"2018-05-01T01:58:20.387Z","1.3.0":"2018-05-04T21:42:12.466Z","1.4.0":"2018-05-05T02:11:17.964Z"},"maintainers":[{"name":"rauschma","email":"axel@rauschma.de"}],"description":"``` npm install @rauschma/stringio ``` <!-- ########################################################## -->","author":{"name":"Axel Rauschmayer"},"readme":"# stringio: convert strings to Node.js streams and vice versa\n\n```\nnpm install @rauschma/stringio\n```\n<!-- ########################################################## -->\n\n## Strings ↔︎ streams\n\nSee line A and line B:\n\n```js\nimport * as assert from 'assert';\nimport { StringStream, readableToString } from '@rauschma/stringio';\n\ntest('From string to stream to string', async () => {\n  const str = 'Hello!\\nHow are you?\\n';\n  const stringStream = new StringStream(str); // (A)\n  const result = await readableToString(stringStream); // (B)\n  assert.strictEqual(result, str);\n});\n```\n\n### `StringStream`: from string to stream\n\n```typescript\ndeclare class StringStream extends Readable {\n  constructor(str: string);\n}\n```\n\nUsed in line A.\n\n### `readableToString`: from stream to string\n\n```typescript\ndeclare function readableToString(readable: Readable, encoding?: string): Promise<string>;\n```\n\nDefault encoding is `'utf-8'`.\n\nUsed in line B.\n\n#### Reading stdin into a string\n\n```typescript\nasync function readStdin() {\n  const str = await readableToString(process.stdin);\n  console.log('STR: '+str);\n}\n```\n\n### Related npm packages\n\n* [`string-to-stream`](https://github.com/feross/string-to-stream): Convert a string into a stream.\n* [`get-stream`](https://github.com/sindresorhus/get-stream): Get a stream as a string, buffer, or array.\n\n<!-- ########################################################## -->\n\n## Asynchronous iterables\n\n### `chunksToLinesAsync`: async iterable over chunks to async iterable over lines\n\n```typescript\ndeclare function chunksToLinesAsync(chunks: AsyncIterable<string>): AsyncIterable<string>;\n```\n\nEach line includes the line break at the end (if any – the last line may not have one).\n\nExample (starting with Node.js v.10, readable streams are asynchronous iterables):\n\n```js\nconst fs = require('fs');\nconst {chunksToLinesAsync} = require('@rauschma/stringio');\n\nasync function main() {\n  const stream = fs.createReadStream(process.argv[2]);\n    // Works, too: const stream = process.stdin;\n  for await (const line of chunksToLinesAsync(stream)) {\n    console.log(chomp(line));\n  }\n}\nmain();\n```\n\n<!-- ########################################################## -->\n\n## Promisified writing to streams\n\n```typescript\ndeclare function streamWrite(\n  stream: Writable,\n  chunk: string | Buffer | Uint8Array,\n  encoding = 'utf8')\n  : Promise<void>;\n\ndeclare function streamEnd(\n  stream: Writable)\n  : Promise<void>;\n```\n\nUsage:\n\n```js\nawait streamWrite(someStream, 'abc');\nawait streamWrite(someStream, 'def');\nawait streamEnd(someStream);\n```\n\n<!-- ########################################################## -->\n\n## `onExit(childProcess)`: wait until a child process is finished\n\n```ts\nexport declare function onExit(childProcess: ChildProcess): Promise<void>;\n```\n\nUsage:\n\n```js\nconst childProcess = child_process.spawn(···);\nawait onExit(childProcess);\n```\n\nErrors emitted by `childProcess` or a non-zero exit code reject the Promise returned by `onExit()`.\n\n<!-- ########################################################## -->\n\n## String helper function\n\n### `chomp`: remove a line break at the end of a line\n\n```typescript\ndeclare function chomp(line: string): string;\n```\n\n## Further reading\n\nThe following 2ality blog posts use `stringio`:\n\n* [Reading streams via async iteration in Node.js](http://2ality.com/2018/04/async-iter-nodejs.html)\n* [Working with stdout and stdin of a child process in Node.js](http://2ality.com/2018/05/child-process-streams.html)\n\n## Acknowledgements\n\n* `StringStream` is inspired by: https://github.com/feross/string-to-stream/blob/master/index.js","readmeFilename":"README.md","homepage":"https://github.com/rauschma/stringio#readme","repository":{"type":"git","url":"git+https://github.com/rauschma/stringio.git"},"bugs":{"url":"https://github.com/rauschma/stringio/issues"}}