{"_id":"l","_rev":"12-12918c0885830882728440b75fcd6d9f","name":"l","dist-tags":{"latest":"0.6.0"},"versions":{"0.0.1":{"name":"l","version":"0.0.1","author":{"name":"Yobi"},"_id":"l@0.0.1","maintainers":[{"name":"johnnywengluu","email":"johnny.weng.luu@gmail.com"}],"bugs":{"url":"https://github.com/johnnywengluu/link/issues"},"bin":{"l":"./bin/l"},"dist":{"shasum":"18dd6a4db10059ab08863fbdf0390dd2dfb73196","tarball":"https://registry.npmjs.org/l/-/l-0.0.1.tgz","integrity":"sha512-YPyI+322pKheTj4C41AzHPEQvU0RYtSK13RDbbPdsTzsZtzMhS1aN3mG0pfvMk+4/kanCWMxf938K+AgUu1jyQ==","signatures":[{"sig":"MEQCIBdAHcuDkuggX3Ft8U7YrE0d4NxCPr2GcoVCYsWYOr0xAiA0pI4T9PhVYSLakKcx53kJjdvPjw4QxdTY4JXqNb16ZQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./lib/l","engines":{"node":"*"},"private":false,"_npmUser":{"name":"johnnywengluu","email":"johnny.weng.luu@gmail.com"},"repository":{"url":"git://github.com/johnnywengluu/link.git","type":"git"},"_npmVersion":"1.0.106","description":"Web application framework for linking everything together","_nodeVersion":"v0.6.0","dependencies":{"ejs":"*","jsdom":"*","jQuery":"*","mkdirp":"*","rimraf":"*","connect":"*","express":"*","hook.io":"*","coffeekup":"*","commander":"*","validator":"*","underscore":"*","coffee-script":"*","eventemitter2":"*"},"_defaultsLoaded":true,"devDependencies":{"mocha":"*","should":"*"},"_engineSupported":true,"directories":{}},"0.5.0":{"name":"l","version":"0.5.0","keywords":["sync","async","promise","stream","flow","control"],"author":{"url":"http://www.etabits.com/","name":"Hasan Arous","email":"arous.hasan@gmail.com"},"license":"MIT","_id":"l@0.5.0","maintainers":[{"name":"aularon","email":"arous.hasan@gmail.com"}],"homepage":"https://github.com/etabits/l#readme","bugs":{"url":"https://github.com/etabits/l/issues"},"dist":{"shasum":"83f913431854c4812a53023ad64fcb17ce967745","tarball":"https://registry.npmjs.org/l/-/l-0.5.0.tgz","integrity":"sha512-dTVTKHUCzXSjl6DzrOL9OMk1oB8EC8azosfpJroDCJ48PSNyyYdkvrojJsMJEftCtYps0sP+axKRMQltEC4cWA==","signatures":[{"sig":"MEYCIQCfrjFLOCxjwJn+7X93XWJpnN1RFUZMoDdEWZQ3NAemXQIhAP+j02Mx7aDYEaStZdaLMa0j7jkh4EPJxCOzAtoLnWZi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"83f913431854c4812a53023ad64fcb17ce967745","gitHead":"3c03d00ab96ac48a103a035d159d9116d181ba36","scripts":{"test":"nyc ava","pretest":"standard --verbose && jshint --verbose --exclude-path .gitignore .","coverage":"nyc report --reporter=text-lcov | coveralls"},"_npmUser":{"name":"aularon","email":"arous.hasan@gmail.com"},"repository":{"url":"git+https://github.com/etabits/l.git","type":"git"},"_npmVersion":"2.15.11","description":"Mix Async/Sync code with Promises and Streams in a reusable unified line","directories":{"test":"test"},"_nodeVersion":"4.7.3","jshintConfig":{"asi":true,"node":true,"strict":true,"esversion":6},"devDependencies":{"ava":"^0.17.0","nyc":"^10.1.2","jshint":"^2.9.4","standard":"^8.6.0","coveralls":"^2.11.15"},"_npmOperationalInternal":{"tmp":"tmp/l-0.5.0.tgz_1488910819588_0.5711225781124085","host":"packages-12-west.internal.npmjs.com"}},"0.5.1":{"name":"l","version":"0.5.1","keywords":["sync","async","promise","stream","flow","control"],"author":{"url":"http://www.etabits.com/","name":"Hasan Arous","email":"arous.hasan@gmail.com"},"license":"MIT","_id":"l@0.5.1","maintainers":[{"name":"aularon","email":"arous.hasan@gmail.com"}],"homepage":"https://github.com/etabits/l#readme","bugs":{"url":"https://github.com/etabits/l/issues"},"dist":{"shasum":"8e9f1cf8aa56bb778e25e22e53d8de45279cdb7c","tarball":"https://registry.npmjs.org/l/-/l-0.5.1.tgz","integrity":"sha512-Yz2SammxgMjbH01N0YP4SejzFxcLvgSdBLWvnhhCkfkw1EwYZhF2ZNP+IIUUCHgUwSt9rgX5Xeh/0Lx5GRTP6w==","signatures":[{"sig":"MEUCIQD6pG65Bv4dGBwnycPUrlIMQQzlpFTpKk982ccHOWFeBgIgRyD2EkdPazGhOAx+g5f4QtIv5ZnRn3UB/cM25sRhdJc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"8e9f1cf8aa56bb778e25e22e53d8de45279cdb7c","gitHead":"df6b8d7fbf48f73034cc94c082f30bd43085fcbe","scripts":{"test":"nyc ava","pretest":"standard --verbose && jshint --verbose --exclude-path .gitignore .","coverage":"nyc report --reporter=text-lcov | coveralls"},"_npmUser":{"name":"aularon","email":"arous.hasan@gmail.com"},"repository":{"url":"git+https://github.com/etabits/l.git","type":"git"},"_npmVersion":"2.15.11","description":"Mix Async/Sync code with Promises and Streams in a reusable unified line","directories":{"test":"test"},"_nodeVersion":"4.7.3","jshintConfig":{"asi":true,"node":true,"strict":true,"esversion":6},"devDependencies":{"ava":"^0.17.0","nyc":"^10.1.2","jshint":"^2.9.4","standard":"^8.6.0","coveralls":"^2.11.15"},"_npmOperationalInternal":{"tmp":"tmp/l-0.5.1.tgz_1488911063168_0.5650563053786755","host":"packages-12-west.internal.npmjs.com"}},"0.6.0":{"name":"l","version":"0.6.0","keywords":["sync","async","promise","stream","flow","control"],"author":{"url":"http://www.etabits.com/","name":"Hasan Arous","email":"arous.hasan@gmail.com"},"license":"MIT","_id":"l@0.6.0","maintainers":[{"name":"aularon","email":"arous.hasan@gmail.com"}],"homepage":"https://github.com/etabits/l#readme","bugs":{"url":"https://github.com/etabits/l/issues"},"dist":{"shasum":"1dac0e062ac94d29827facd8d0166aa5f196c56f","tarball":"https://registry.npmjs.org/l/-/l-0.6.0.tgz","integrity":"sha512-rB5disIyfKRBQ1xcedByHCcAmPWy2NPnjWo5u4mVVIPtathROHyfHjkloqSBT49mLnSRnupkpoIUOFCL7irCVQ==","signatures":[{"sig":"MEYCIQCRW6604oKwdQvqsEfOaFFQaV4JvHYIam6dWxVAhD52EAIhALqrTVlMW4U1vvQSVG1L53OSzeWC51FMzGhJq3h4kAb2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"1dac0e062ac94d29827facd8d0166aa5f196c56f","gitHead":"d3b29093eace9adb3e3649d99b0a27e466fb3748","scripts":{"test":"nyc ava","pretest":"standard --verbose && jshint --verbose --exclude-path .gitignore .","coverage":"nyc report --reporter=text-lcov | coveralls"},"_npmUser":{"name":"aularon","email":"arous.hasan@gmail.com"},"repository":{"url":"git+https://github.com/etabits/l.git","type":"git"},"_npmVersion":"2.15.11","description":"Mix Async/Sync code with Promises and Streams in a reusable unified line","directories":{"test":"test"},"_nodeVersion":"4.7.3","jshintConfig":{"asi":true,"node":true,"strict":true,"esversion":6},"devDependencies":{"ava":"^0.17.0","nyc":"^10.1.2","jshint":"^2.9.4","standard":"^8.6.0","coveralls":"^2.11.15"},"_npmOperationalInternal":{"tmp":"tmp/l-0.6.0.tgz_1497859268466_0.5394328506663442","host":"s3://npm-registry-packages"}}},"time":{"created":"2011-11-30T06:55:35.033Z","modified":"2025-04-28T05:53:52.009Z","0.0.1":"2011-11-30T06:55:38.624Z","0.5.0":"2017-03-07T18:20:21.534Z","0.5.1":"2017-03-07T18:24:25.262Z","0.6.0":"2017-06-19T08:01:09.455Z"},"bugs":{"url":"https://github.com/etabits/l/issues"},"author":{"url":"http://www.etabits.com/","name":"Hasan Arous","email":"arous.hasan@gmail.com"},"license":"MIT","homepage":"https://github.com/etabits/l#readme","keywords":["sync","async","promise","stream","flow","control"],"repository":{"url":"git+https://github.com/etabits/l.git","type":"git"},"description":"Mix Async/Sync code with Promises and Streams in a reusable unified line","maintainers":[{"name":"aularon","email":"arous.hasan@gmail.com"}],"readme":"# L\n> Mix Async/Sync code with Promises and Streams in a reusable unified line\n\n[![Build Status](https://travis-ci.org/etabits/l.svg?branch=master)](https://travis-ci.org/etabits/l)\n[![Coverage Status](https://coveralls.io/repos/github/etabits/l/badge.svg?branch=master)](https://coveralls.io/github/etabits/l?branch=master)\n\nYou have multiple functions, some of them are **async**, others are **promise**-based, and you have some **stream** transformers, and you want to plug everything together: This module **takes an array of functions/streams and gives you a single function**, that can be used with callback, or as a promise. It takes care of piping consecutive streams, buffering them before passing them to the next function... etc.\n\n## Installation\n```sh\nnpm install --save l\n```\n\n## Features\n* A segment can be sync, async with a callback, can return a promise, or can define a stream\n* Consecutive streams are automatically piped, only buffered when next segment is not a stream\n* You can return a stream, and it will be automatically buffered/piped\n\n## Usage Example\n```js\nconst l = require('l');\n\nvar calc = l([\n  (val) => val * 5, // sync\n  { // Split\n    add: (val) => Promise.resolve(val + 2), // promise\n    mul: (val, done) => process.nextTick(() => done(null, val * 7)) // async\n  },\n  (composed) => composed.add + composed.mul // Join\n])\n\ncalc(1, function (error, answer) { // with a callback\n  require('assert').strictEqual(answer, 42)\n})\n\ncalc(Math.PI).then(result => { // as a promise\n  console.log(result) // 127.66370614359172\n})\n```\nFor a more complete example that involves streams, please check [examples](https://github.com/etabits/l/tree/master/examples) and [tests](https://github.com/etabits/l/tree/master/test).\n\n## Debugging\nTo enable debugging:\n```sh\nDEBUG=line node ./examples/npm-module-github-stats.js penguin\n```\n<!--- I mark it as ruby because colors look nice -->\n```ruby\n>executing on: penguin (5 segments)\n   0 <async IncomingMessage {   _readableState: [Object],   readable: true,...\n   1 @consuming readable stream...\n   1 <sync { _id: 'penguin',   _rev: '151-868f4a334cf6a0bc8ced2f4485e7da78',   name: 'penguin',...\n   2 <promise etabits/node-penguin\n   3 <async IncomingMessage {   _readableState: [Object],   readable: true,...\n   4 @consuming readable stream...\n   4 <sync { gh: [Object],   npm: [Object] }...\n<finished with { gh: [Object],   npm: [Object] }...\n```\n\n## Running tests\n```sh\nnpm test\n```\n\n## Compatibility\n* L is compatible with [Node.js v6 LTS](https://nodejs.org/en/download/), [Node.js v7 Current](https://nodejs.org/en/download/current/), Node.js v5 and Node.js v4\n\n## Next (Roadmap)\n* Ability to split and rejoin a stream (parallel execution)\n* Return a readable stream when last element is a stream (optional)\n* Syntactic sugar, once uses cases are established, so we have a stable API\n* Browser use?\n* objectMode streams between segments\n* create objectMode stream duplex instead of a function wrapper\n* ...\n","readmeFilename":"README.md","users":{"mengo6988":true}}