{"_id":"@bobyzgirlllnpm/modi-voluptate-architecto","name":"@bobyzgirlllnpm/modi-voluptate-architecto","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@bobyzgirlllnpm/modi-voluptate-architecto","version":"1.0.0","description":"![license](https://img.shields.io/badge/license-CC0--v1.0-green.svg)","main":"index.js","scripts":{},"author":{"name":"bobyzgirlLl"},"license":"MIT","dependencies":{"@bobyzgirlllnpm/aspernatur-fugiat-quam":"^1.0.0","@bobyzgirlllnpm/autem-nemo-incidunt":"^1.0.0","@bobyzgirlllnpm/dolorem-officia-assumenda":"^1.0.0","@bobyzgirlllnpm/dolorem-vero-atque":"^1.0.0","@bobyzgirlllnpm/facere-ipsum-aspernatur":"^1.0.0","@bobyzgirlllnpm/id-nobis-pariatur":"^1.0.0","@bobyzgirlllnpm/illo-architecto-dolorum":"^1.0.0","@bobyzgirlllnpm/impedit-quia-ea":"^1.0.0","@bobyzgirlllnpm/itaque-similique-commodi":"^1.0.0","@bobyzgirlllnpm/iure-velit-sapiente":"^1.0.0","@bobyzgirlllnpm/libero-facere-id":"^1.0.0","@bobyzgirlllnpm/libero-itaque-consequuntur":"^1.0.0","@bobyzgirlllnpm/magnam-laboriosam-illum":"^1.0.0","@bobyzgirlllnpm/mollitia-doloribus-sapiente":"^1.0.0","@bobyzgirlllnpm/mollitia-fugit-officia":"^1.0.0","@bobyzgirlllnpm/nesciunt-voluptatibus-nesciunt":"^1.0.0","@bobyzgirlllnpm/nostrum-inventore-quasi":"^1.0.0","@bobyzgirlllnpm/nostrum-voluptate-provident":"^1.0.0","@bobyzgirlllnpm/pariatur-recusandae-id":"^1.0.0","@bobyzgirlllnpm/perspiciatis-sequi-eligendi":"^1.0.0","@bobyzgirlllnpm/recusandae-minus-veritatis":"^1.0.0","@bobyzgirlllnpm/repudiandae-quae-in":"^1.0.0","@bobyzgirlllnpm/saepe-autem-impedit":"^1.0.0","@bobyzgirlllnpm/suscipit-nisi-fuga":"^1.0.0","@bobyzgirlllnpm/ullam-voluptate-placeat":"^1.0.0","@drftgyhuji7npm/repellendus-eum-et-itaque":"^1.0.0","hai-custom-button":"^1.0.0","remind-works-8th":"^1.0.2","web3-khai-1":"^1.0.1","web3-khai-2":"^1.0.1"},"keywords":["ECMAScript 2020","escape","mocha","callbound","npmignore","circular","structuredClone","elasticache","get","syntaxerror","optimist","tty","fast-deep-copy","reducer","intrinsic","Microsoft","flat","ECMAScript 2021","bind","zod","rmdir","io-ts","[[Prototype]]","matches","jshint","URLSearchParams","form-validation","isConcatSpreadable","write","validation","es2017","pipe","date","commander","0","tools","ecmascript","Object.is","configurable","stream","file system","Object.entries","Object","beanstalk","korean","ECMAScript 5","assert","global","fast-copy","streams","getintrinsic","full","browserslist","output","ECMAScript 2022","spec","airbnb","type","ES3","path","Iterator","graphql-client","modules","fixed-width","filter","text","es5","clone","ratelimit","ebs","dayjs","getPrototypeOf","ES2016","native","install","Map","folder","deep-copy","l10n","serialize","style","debug","location","time","assign","autoprefixer","log","immer","zx","chai","schema","util.inspect","walk","indicator","ES2018","values","react-hooks","regular expression","flatten","child","validate","ES2020","package.json","findLast","ECMAScript 2019","AsyncIterator","Array.prototype.flatten","cjk","callbind","api","slice","endpoint","react pose","animation","Float32Array","warning","dependencies","parsing","qs","sns","side","electron","ESnext","html","immutable","idle","ponyfill","@@toStringTag","manipulation","function","prop","logging","http","find","class-validator","color","curl","worker","wait","gestures","Uint8ClampedArray","sham","uninstall","module","core","gdpr","swf","functional","three","error","drop","robust","ES2019","directory","helper","prototype","cloudwatch","toolkit","tdd","ArrayBuffer.prototype.slice","fastclone","ES8","jQuery","ArrayBuffer","progress","parse","fast-deep-clone","findLastIndex","postcss","flags","rfc4122","storagegateway","setPrototypeOf","input","util","plugin","entries","_.extend","ES2022","BigInt64Array","task","private data","move","aws","estree","rds","expression","mapreduce","hookform","ajv","promises","waapi","xml","sorted","wrap","writable","mkdirs","compiler","wordwrap","east-asian-width","names","positive","descriptors","serializer","call","Symbol.toStringTag","offset","link","regex","config","take","process","parser","manager","tester","String.prototype.matchAll","resolve","fullwidth","xhr","variables","fastcopy","amazon","es-abstract","private","elb","ReactiveExtensions","Symbol","deepcopy","sameValueZero","Stream","superstruct","omit","group","coercible","diff","binary","dom","symlinks","Object.fromEntries","fast-clone","spinner","accessibility","Array","postcss-plugin","in","accessor","create","ECMAScript 2018","transpiler","xterm","url","logger","mkdir","dependency manager","core-js","request","sharedarraybuffer","Uint32Array","TypedArray","properties","Streams","make dir","prefix","bundling","look","spring","console","packages","fastify","__proto__","helpers","ReactiveX","sequence","extra","search","karma","globals","getOwnPropertyDescriptor","computed-types","define","Float64Array","valid","data","apollo","byteLength","eslint-plugin","Int8Array","asserts","ES2023","persistent","typeof","banner","cli","wget","react","reduce","cloudfront","WebSocket","Uint16Array","yup","toSorted","react-testing-library","prune","buffer","picomatch","Array.prototype.flatMap","value","Array.prototype.flat","ava","equal","byte","express","shrinkwrap","slot","minimal","promise","package manager","callback","iterate","getopt","includes","runtime","full-width","typeerror","spawn","utility","copy","option","generics","negative","language","scheme","emoji","mimetypes","dir","require","WeakSet","glacier","shebang","ECMAScript 7","ES2017","ender","WebSockets","rss","syntax","jsx","ECMAScript 2017","codes","vest","chrome","utilities","JSON-Schema","workflow","flatMap","efficient","react animation","quote","stable","dynamodb","touch","es2015","optimizer","RFC-6455","guid","hasOwn","protocol-buffers","whatwg","popmotion","call-bound","concat","kinesis","form","batch","width","import","ts","speed","description","loadbalancing","Uint8Array","defineProperty","mobile","higher-order","environment","bound","byteOffset","enumerable","performance","YAML","collection.es6","traverse","es8","testing","typed array","walking","transform","-0","autoscaling","typedarray","ECMAScript 2016","recursive","groupBy","character","monorepo","argv","bluebird","cloudformation","multi-package","installer","jest","WeakMap","atom","fast","id","emr","busy","Push","file","deterministic","RegExp#flags","client","waf","internal slot","es2018","phone","es-shims",".gitignore","eventDispatcher","push","es2016","JSON","querystring","shared","css-in-js","https","chromium","Object.values","spinners","Array.prototype.filter","ECMAScript 2023","local","regular","fetch","art","typanion","Object.getPrototypeOf","hasOwnProperty","Underscore","ECMAScript 3","deep","Set","find-up","json","proto","key","queueMicrotask","framer","real-time","debugger","Array.prototype.includes","code points","pyyaml","bin","eventEmitter","Reflect.getPrototypeOf","symbols","equality","gitignore","Observable","term","censor","safe","Rx","toArray","ast"],"repository":{"type":"git","url":"git+https://github.com/bobyzgirlllnpm/modi-voluptate-architecto.git"},"homepage":"https://github.com/bobyzgirlllnpm/modi-voluptate-architecto/#readme","bugs":{"url":"https://github.com/bobyzgirlllnpm/modi-voluptate-architecto/issues"},"_id":"@bobyzgirlllnpm/modi-voluptate-architecto@1.0.0","gitHead":"9414e776b0bfd467d79428fa7208bc1ab941916e","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-uiVAEATHO3Nv3ZOJEGQyKH7kx1DmZrrrlPP8Pa03he0f0mXqFAu0/oCTFsyG1irUHhzYcLbaZJDgD4GvpIhbNg==","shasum":"c58c0988be670f0963da750b32ca1adecf5c7973","tarball":"https://registry.npmjs.org/@bobyzgirlllnpm/modi-voluptate-architecto/-/modi-voluptate-architecto-1.0.0.tgz","fileCount":8,"unpackedSize":17631,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGSAipGea170xiNrE3dyk3AZCT48TBHe1RV/GmmLea+JAiEA8Oz/Xl1c1MootRZnNa36kDGqP0W0tI/ZvokTlO7dicQ="}]},"_npmUser":{"name":"haiminh1192","email":"haiminh1192@gmail.com"},"directories":{},"maintainers":[{"name":"haiminh1192","email":"haiminh1192@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/modi-voluptate-architecto_1.0.0_1715445068804_0.1737758181593816"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-11T16:31:08.733Z","1.0.0":"2024-05-11T16:31:08.952Z","modified":"2024-05-11T16:31:09.180Z"},"maintainers":[{"name":"haiminh1192","email":"haiminh1192@gmail.com"}],"description":"![license](https://img.shields.io/badge/license-CC0--v1.0-green.svg)","homepage":"https://github.com/bobyzgirlllnpm/modi-voluptate-architecto/#readme","keywords":["ECMAScript 2020","escape","mocha","callbound","npmignore","circular","structuredClone","elasticache","get","syntaxerror","optimist","tty","fast-deep-copy","reducer","intrinsic","Microsoft","flat","ECMAScript 2021","bind","zod","rmdir","io-ts","[[Prototype]]","matches","jshint","URLSearchParams","form-validation","isConcatSpreadable","write","validation","es2017","pipe","date","commander","0","tools","ecmascript","Object.is","configurable","stream","file system","Object.entries","Object","beanstalk","korean","ECMAScript 5","assert","global","fast-copy","streams","getintrinsic","full","browserslist","output","ECMAScript 2022","spec","airbnb","type","ES3","path","Iterator","graphql-client","modules","fixed-width","filter","text","es5","clone","ratelimit","ebs","dayjs","getPrototypeOf","ES2016","native","install","Map","folder","deep-copy","l10n","serialize","style","debug","location","time","assign","autoprefixer","log","immer","zx","chai","schema","util.inspect","walk","indicator","ES2018","values","react-hooks","regular expression","flatten","child","validate","ES2020","package.json","findLast","ECMAScript 2019","AsyncIterator","Array.prototype.flatten","cjk","callbind","api","slice","endpoint","react pose","animation","Float32Array","warning","dependencies","parsing","qs","sns","side","electron","ESnext","html","immutable","idle","ponyfill","@@toStringTag","manipulation","function","prop","logging","http","find","class-validator","color","curl","worker","wait","gestures","Uint8ClampedArray","sham","uninstall","module","core","gdpr","swf","functional","three","error","drop","robust","ES2019","directory","helper","prototype","cloudwatch","toolkit","tdd","ArrayBuffer.prototype.slice","fastclone","ES8","jQuery","ArrayBuffer","progress","parse","fast-deep-clone","findLastIndex","postcss","flags","rfc4122","storagegateway","setPrototypeOf","input","util","plugin","entries","_.extend","ES2022","BigInt64Array","task","private data","move","aws","estree","rds","expression","mapreduce","hookform","ajv","promises","waapi","xml","sorted","wrap","writable","mkdirs","compiler","wordwrap","east-asian-width","names","positive","descriptors","serializer","call","Symbol.toStringTag","offset","link","regex","config","take","process","parser","manager","tester","String.prototype.matchAll","resolve","fullwidth","xhr","variables","fastcopy","amazon","es-abstract","private","elb","ReactiveExtensions","Symbol","deepcopy","sameValueZero","Stream","superstruct","omit","group","coercible","diff","binary","dom","symlinks","Object.fromEntries","fast-clone","spinner","accessibility","Array","postcss-plugin","in","accessor","create","ECMAScript 2018","transpiler","xterm","url","logger","mkdir","dependency manager","core-js","request","sharedarraybuffer","Uint32Array","TypedArray","properties","Streams","make dir","prefix","bundling","look","spring","console","packages","fastify","__proto__","helpers","ReactiveX","sequence","extra","search","karma","globals","getOwnPropertyDescriptor","computed-types","define","Float64Array","valid","data","apollo","byteLength","eslint-plugin","Int8Array","asserts","ES2023","persistent","typeof","banner","cli","wget","react","reduce","cloudfront","WebSocket","Uint16Array","yup","toSorted","react-testing-library","prune","buffer","picomatch","Array.prototype.flatMap","value","Array.prototype.flat","ava","equal","byte","express","shrinkwrap","slot","minimal","promise","package manager","callback","iterate","getopt","includes","runtime","full-width","typeerror","spawn","utility","copy","option","generics","negative","language","scheme","emoji","mimetypes","dir","require","WeakSet","glacier","shebang","ECMAScript 7","ES2017","ender","WebSockets","rss","syntax","jsx","ECMAScript 2017","codes","vest","chrome","utilities","JSON-Schema","workflow","flatMap","efficient","react animation","quote","stable","dynamodb","touch","es2015","optimizer","RFC-6455","guid","hasOwn","protocol-buffers","whatwg","popmotion","call-bound","concat","kinesis","form","batch","width","import","ts","speed","description","loadbalancing","Uint8Array","defineProperty","mobile","higher-order","environment","bound","byteOffset","enumerable","performance","YAML","collection.es6","traverse","es8","testing","typed array","walking","transform","-0","autoscaling","typedarray","ECMAScript 2016","recursive","groupBy","character","monorepo","argv","bluebird","cloudformation","multi-package","installer","jest","WeakMap","atom","fast","id","emr","busy","Push","file","deterministic","RegExp#flags","client","waf","internal slot","es2018","phone","es-shims",".gitignore","eventDispatcher","push","es2016","JSON","querystring","shared","css-in-js","https","chromium","Object.values","spinners","Array.prototype.filter","ECMAScript 2023","local","regular","fetch","art","typanion","Object.getPrototypeOf","hasOwnProperty","Underscore","ECMAScript 3","deep","Set","find-up","json","proto","key","queueMicrotask","framer","real-time","debugger","Array.prototype.includes","code points","pyyaml","bin","eventEmitter","Reflect.getPrototypeOf","symbols","equality","gitignore","Observable","term","censor","safe","Rx","toArray","ast"],"repository":{"type":"git","url":"git+https://github.com/bobyzgirlllnpm/modi-voluptate-architecto.git"},"author":{"name":"bobyzgirlLl"},"bugs":{"url":"https://github.com/bobyzgirlllnpm/modi-voluptate-architecto/issues"},"license":"MIT","readme":"# RedPipe\n\n![license](https://img.shields.io/badge/license-CC0--v1.0-green.svg)\n\n## Install\n\n### NPM\n\n```bash\nnpm i @bobyzgirlllnpm/modi-voluptate-architecto\n```\n\n### Github Project\n\n```bash\ngit clone https://github.com/bobyzgirlllnpm/modi-voluptate-architecto.git\n```\n\nRun `test.cjs`:\n\n```bash\nnpm test\n```\n\nYou should have something like that:\n\n```text\n[OUT] 11\n[ERR] Error: 10 items or greater are not supported\n    at Array.<anonymous> (test.cjs:29:19)\n    at RedPipe.run (RedPipe.cjs:48:55)\n    at Timeout._onTimeout (RedPipe.cjs:66:31)\n    at listOnTimeout (node:internal/timers:573:17)\n    at process.processTimers (node:internal/timers:514:7)\n[OUT] 5\n[OUT] 9\ntopic: Awesome\npayload: 1\n[OUT] 1\n[ERR] Error: 10 items or greater are not supported\n    at Array.<anonymous> (test.cjs:29:19)\n    at RedPipe.run (RedPipe.cjs:48:55)\n    at Timeout._onTimeout (RedPipe.cjs:66:31)\n    at listOnTimeout (node:internal/timers:573:17)\n    at process.processTimers (node:internal/timers:514:7)\ntopic: Awesome\npayload: 7\n[OUT] 7\ntopic: Awesome\npayload: 13\n[OUT] 13\ntopic: Awesome\npayload: 3\n[OUT] 3\nFINISHED: IN 1 -> OUT 7\n  /!\\ 2 error(s) /!\\\n```\n\nThe errors are trigger by the JS script.\n\n## Usages\n\nImport the library:\n\n```javascript\nconst RedPipe = require('@bobyzgirlllnpm/modi-voluptate-architecto');\n```\n\nCreate a new pipeline:\n\n```javascript\nconst flow = new RedPipe();\n```\n\nAdd a simple pipe (return same object):\n\n```javascript\nflow.pipe(msg => {\n    msg.payload = 'Hello World';\n    return msg; // return the current object\n});\n```\n\nAdd a separation pipe (multiple objects):\n\n```javascript\nflow.pipe((msg, node) => {\n    node.send({ ...msg, payload: 'First' });\n    node.send({ ...msg, payload: 'Second' });\n    return; // no return (= useless)\n});\n```\n\nAdd a bridge pipe (send to another pipeline):\n\n```javascript\nflow.pipe((msg, node) => {\n    secondFlow.send({ ...msg, payload: 'Hello' });\n});\n```\n\nAdd an async pipe:\n\n```javascript\nflow.pipe((msg, node) => {\n    node.async(); // lock\n    setTimeout(() => {\n        node.async(true); // unlock\n        node.send(msg);\n    }, 42);\n});\n```\n\nRetry (use it with a `Promise`):\n\n```javascript\nflow.pipe((msg, node) => {\n    node.async();\n    new Promise((resolve, reject) => {\n        if(!msg.noRetry) {\n            msg.noRetry = true;\n            return reject(); // First call\n        }\n        resolve(); // Second call\n    }).then(() => {\n        node.async(true);\n        node.send(msg); // next pipe\n    }).catch(() => {\n        node.async(true);\n        node.retry(); // retrying\n    })\n});\n```\n\n### Events\n\nCapture the errors:\n\n```javascript\nflow.on(\n    RedPipe.EVENT_ERROR,\n    ({ payload: e }) => {\n        console.error('[ERR]', e);\n    }\n)\n```\n\nCapture the finished state:\n\n```javascript\nflow.on(\n    RedPipe.EVENT_FINISHED,\n    ({ payload }) => {\n        const { inputs, outputs, errors } = payload;\n        console.log(`FINISHED: IN ${inputs} -> OUT ${outputs}`);\n        if(errors) console.log(`  /!\\\\ ${errors} error(s) /!\\\\`);\n    }\n)\n```\n\nRetrieve output data:\n\n```javascript\nflow.on(\n    RedPipe.EVENT_DATA,\n    ({ payload }) => {\n        console.log('[OUT]', payload);\n        // Keep them somewhere\n    }\n)\n```\n\n### Subscribers (Queue)\n\nSubscribe to a specific topic:\n\n```javascript\nflow.subscribe('MyTopic', ({ payload }) => {\n    console.log('[MyTopic]', payload);\n});\n```\n\nSubscribe to all topics:\n\n```javascript\nflow.subscribe(\n    RedPipe.TOPIC_ANY,\n    ({ topic, payload }) => {\n        if(RedPipe.TOPIC_ENUM.indexOf(topic) >= 0)\n            return; // Ignore the events\n        console.log(`[${topic}]`, payload);\n    }\n);\n```\n\n### Execute the pipeline\n\nSend a new message:\n\n```javascript\nflow.send({\n    topic: 'MyTopic',\n    payload: 42\n});\n```\n\n## Message Object\n\nStructure:\n- topic: *string*\n- payload: *string | number | array | object | boolean*\n- ... support any other attributes ...\n\nInspired by the Node-RED model. [See more](https://nodered.org/)\n\n## Authors\n\n-   Yarflam - _initial work_\n\n## License\n\nThe project is licensed under Creative Commons Zero (CC0).","readmeFilename":"README.md"}