{"id":20556470,"url":"https://github.com/author/shell-middleware","last_synced_at":"2026-04-11T23:43:33.308Z","repository":{"id":57099832,"uuid":"243999133","full_name":"author/shell-middleware","owner":"author","description":"Common middleware for shell applications (Browser \u0026 Node.js runtimes)","archived":false,"fork":false,"pushed_at":"2020-02-29T17:16:23.000Z","size":4,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-19T18:18:20.302Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/author.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["coreybutler"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-02-29T16:07:53.000Z","updated_at":"2022-08-05T22:08:28.000Z","dependencies_parsed_at":"2022-08-22T23:10:39.337Z","dependency_job_id":null,"html_url":"https://github.com/author/shell-middleware","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/author%2Fshell-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/author%2Fshell-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/author%2Fshell-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/author%2Fshell-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/author","download_url":"https://codeload.github.com/author/shell-middleware/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242163854,"owners_count":20082224,"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":[],"created_at":"2024-11-16T03:28:05.995Z","updated_at":"2026-04-11T23:43:28.276Z","avatar_url":"https://github.com/author.png","language":"JavaScript","funding_links":["https://github.com/sponsors/coreybutler"],"categories":[],"sub_categories":[],"readme":"# shell-middleware\n\nCommon middleware for [@author.io/shell](https://github.com/author.shell) CLI applications (Browser \u0026amp; Node.js runtimes).\n\n**To Use:** \n\n|Runtime  |Example  |\n|---------|---------|\n| Node.js | _Install:_ `npm install @author.io/shell-middleware -S`\u003cbr/\u003e_Usage:_ `import { ValidInput } from '@author.io/shell-middleware'` |\n| Browser | `import { ValidInput } from 'https://cdn.pika.dev/@author.io/shell-middleware@latest'` |\n\n## Capabilities\n\nThis library contains a collection of commonly used middleware methods for use with a shell app.\n\n```javascript\nimport { Shell } from 'https://cdn.pika.dev/@author.io/shell@latest'\n\n// Import this library...\nimport { MiddlewareA, MiddlewareB } from 'https://cdn.pika.dev/@author.io/shell-middleware@latest'\n\n// Simple shell\nconst shell = new Shell({\n  name: 'my-cli'\n})\n\nshell.use(\u003cmiddleware\u003e) // \u003c----- Apply middleware.\n\n...\n```\n\n### ValidInput\n\nThis method enforces flag processing rules (see [@author.io/arg](https://github.com/author/arg) for options). For example, this method will recognize failure to specify a required flag by displaying a violation notice. All further processing is aborted.\n\n```javascript\nimport { ValidInput } from '...@author.io/shell-middleware@latest'\n\nshell.use(ValidInput)\n```\n\n### ValidInputWithHelp\n\nThis is nearly identical to **ValidInput**, except it will _also display the default help message_.\n\n```javascript\nimport { ValidInputWithHelp } from '...@author.io/shell-middleware@latest'\n\nshell.use(ValidInputWithHelp)\n```\n\n### Log\n\nLog the original command. This is a pass-thru method, so processing will continue.\n\n```javascript\nimport { Log } from '...@author.io/shell-middleware@latest'\n\nshell.use(Log)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauthor%2Fshell-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauthor%2Fshell-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauthor%2Fshell-middleware/lists"}