{"id":22277046,"url":"https://github.com/gregabbott/chute","last_synced_at":"2025-03-25T17:44:32.631Z","repository":{"id":265219006,"uuid":"895465758","full_name":"gregabbott/chute","owner":"gregabbott","description":"Chute works like a pipeline operator for sending data through functions and methods in a dot-notation style. Vanilla JS ~10KB.","archived":false,"fork":false,"pushed_at":"2025-02-15T11:11:54.000Z","size":246,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T12:22:28.636Z","etag":null,"topics":["chain","chaining","dot-notation","function","helper","javascript","method","method-chaining","pipe","pipeline","pipeline-operator","piping","utility","utility-function","vanilla-javascript","vanilla-js"],"latest_commit_sha":null,"homepage":"https://gregabbott.github.io/chute/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gregabbott.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-28T09:06:10.000Z","updated_at":"2025-02-15T11:11:57.000Z","dependencies_parsed_at":"2024-11-28T11:20:09.575Z","dependency_job_id":"c3fd6480-76ab-47ae-8559-dc2d837d45e1","html_url":"https://github.com/gregabbott/chute","commit_stats":null,"previous_names":["gregabbott/chute"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregabbott%2Fchute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregabbott%2Fchute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregabbott%2Fchute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregabbott%2Fchute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregabbott","download_url":"https://codeload.github.com/gregabbott/chute/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245512737,"owners_count":20627641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chain","chaining","dot-notation","function","helper","javascript","method","method-chaining","pipe","pipeline","pipeline-operator","piping","utility","utility-function","vanilla-javascript","vanilla-js"],"created_at":"2024-12-03T14:17:00.308Z","updated_at":"2025-03-25T17:44:32.602Z","avatar_url":"https://github.com/gregabbott.png","language":"JavaScript","readme":"# Chute\nChute works like a pipeline operator for sending data through functions and methods in a dot-notation style.\n```js\n// Chute works like a pipeline operator for functions \u0026 methods\n// .js ~10KB | .min.js ~4KB | MIT License | Vanilla JS \n// =============================================================\n// The demo after this section uses these pseudo functions\nfunction add_one(x){ return x + 1 }\nconst object_of_fns = { two: x =\u003e x * 2, three: x =\u003e x * 3/*…*/}\nconst NG_append = b =\u003e a =\u003e a + b\nconst NG_sum = { add : b =\u003e a =\u003e a + b, minus: b =\u003e a =\u003e a - b }\nconst NG_wrap = x =\u003e [x]\nconst NG_index = n =\u003e l =\u003e l[n]\n// =============================================================\n// Chutes access globals and same-scope items without setup.\nchute// Optional setup lets all chutes access non-global items.\n.feed({// Feed gives all chutes access to functions \u0026 libraries:\n  append: NG_append,// This line provides a function. [^0]\n  times: object_of_fns,// This line gives a library of FNs [^1].\n  // The line also sets a custom name to access the library by.\n}).lift({// Lift lets all chutes call library functions by name.\n  NG_sum// This line gives an object of functions to lift [^2].\n})//Any chute anywhere in a project can now access these items.\n// =============================================================\n/* KEY:[FN=Function][NG=Non-global] */  const demo = /* Value:\n    Start a chute with a seed value */  chute(7)     /* 7\n          Call any global functions */ .add_one      /* 8\n      Use any built-in Chute method */ .log          /* 8\n   Log current data with extra args */ .log('Note')  /* 8\n   Call a NG nested FN by path [^1] */ .times.two    /* 16\n  Call a NG library FN by name [^2] */ .add(64)      /* 80\n     Use any method of current data */ .toString     /* \"80\"\n Use any global native JS functions */ .parseInt     /* 80\n Call any NG not-setup FN in scope… */ .do(NG_wrap)  /* [80]\n     …More calls to it can dot-call */ .NG_wrap      /* [[80]]\n    Pipe data through FN sub-chains */ .do(          /*\n     Use inline functions if needed */   x=\u003ex[0],    /* [80]\n Each FN's return feeds the next FN */   NG_index(0) /* 80\n Hop between sub-chains \u0026 dot calls */ )             /*\n      Use NG FNs from anywhere [^0] */ .append('!')  /* \"80!\"\n     End a chute with an empty call */ ()            /* \"80!\"\n                Use the chute value */ console.log({demo})\n// MORE FEATURES ===============================================\n//     Argument placeholder  Give current data as argument N\n//      Current value token  Use data in inline expressions\n//                      TAP  Run side effects and ignore returns\n//                     PICK  Run if-else FNs on current data\n// 0 ARG STYLE OPTIONS =========================================\n//  Pipeline (deduce calls)  .reverse.JSON.stringify.log()\n//  Dot notation (explicit)  .reverse().JSON.stringify().log()\n//           Both equate to  .reverse \u003e JSON.stringify \u003e log\n// =============================================================\n```\n- For more information, visit [the Chute site](https://chute.pages.dev/) (also at [GitHub Pages](https://gregabbott.github.io/chute/)).\n- Support Chute via:\n  - [Buy me a coffee](https://buymeacoffee.com/gregabbott)\n  - [Kofi](https://ko-fi.com/gregabbott)\n","funding_links":["https://buymeacoffee.com/gregabbott","https://ko-fi.com/gregabbott"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregabbott%2Fchute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregabbott%2Fchute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregabbott%2Fchute/lists"}