{"id":19513030,"url":"https://github.com/invrs/standard-io","last_synced_at":"2026-06-11T06:32:04.472Z","repository":{"id":57369365,"uuid":"52319858","full_name":"invrs/standard-io","owner":"invrs","description":"A standard for javascript function arguments and return values","archived":false,"fork":false,"pushed_at":"2016-07-03T06:25:51.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-10-12T03:58:04.724Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/invrs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-23T01:30:21.000Z","updated_at":"2016-02-23T06:57:37.000Z","dependencies_parsed_at":"2022-08-26T04:31:58.960Z","dependency_job_id":null,"html_url":"https://github.com/invrs/standard-io","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/invrs/standard-io","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invrs%2Fstandard-io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invrs%2Fstandard-io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invrs%2Fstandard-io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invrs%2Fstandard-io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/invrs","download_url":"https://codeload.github.com/invrs/standard-io/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invrs%2Fstandard-io/sbom","scorecard":{"id":492382,"data":{"date":"2025-08-11","repo":{"name":"github.com/invrs/standard-io","commit":"db74e35610e6a2e25d7de63d0468794e0c06cd55"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-19T19:30:51.214Z","repository_id":57369365,"created_at":"2025-08-19T19:30:51.214Z","updated_at":"2025-08-19T19:30:51.214Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34186385,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10T23:28:32.278Z","updated_at":"2026-06-11T06:32:04.448Z","avatar_url":"https://github.com/invrs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StandardIO [![Build Status](https://travis-ci.org/invrs/standard-io.svg?branch=master)](https://travis-ci.org/invrs/standard-io)\n\nA standard for javascript function arguments and return values.\n\n## Overview\n\nStandardIO limits the input and output of all javascript functions to a single object.\n\nOur aim is to make working with Promises more fluid and to open the door for functions [becoming more extensible](#implementation).\n\nThis function adheres to the StandardIO spec:\n\n```js\nfunction hello({ world }) {\n  return `hello ${world}`\n}\n\nhello({ world: \"world\" })\n  // { value: \"hello world\" }\n```\n\nStandardIO makes creating and using promises more succinct:\n\n```js\nfunction hello({ world, promise: { resolve } }) {\n  let fn = () =\u003e resolve({ world: `hello ${world}` })\n  setTimeout(fn, 1)\n}\n\nhello().then(hello).then(console.log)\n  // { world: \"hello hello world\" }\n```\n\nEven functions with hard returns are thenable:\n\n```js\nfunction hello({ world, promise: { resolve } }) {\n  return { world: `hello ${world}` }\n}\n\nhello().then(hello).then(console.log)\n  // { world: \"hello hello world\" }\n```\n\nThe `args` property makes argument objects portable:\n\n```js\nfunction hello({ args, world }) {\n  world = `hello ${world}`\n  return { ...args, world }\n}\n\nhello({ a: true, world: \"world\" })\n  // { a: true, world: \"hello world\" }\n```\n\n## Implementation\n\nStandardIO is a specification for how functions should receive parameters and transform those parameters into an argument for the function (input). It also specifies the format for returning values (output).\n\nCurrently the only way to implement StandardIO with ES6 classes is through [extensions built for Industry](https://github.com/invrs/industry#existing-extensions) that automatically wrap your methods. Industry is a framework for defining extensible factories using ES6 classes.\n\nThe StandardIO pattern enables Industry to extend the inputs and outputs of methods with minimal impact on existing code.\n\n## Specification\n\n1. Object argument\n  1. [`args` property](#args-property)\n  2. [`_args` property](#_args-property)\n  3. [`promise.resolve` property](#promiseresolve-property)\n  4. [`promise.reject` property](#promisereject-property)\n2. Return value object\n  1. [`catch` property](#catch-property)\n  2. [`then` property](#then-property)\n  3. [`value` property](#value-property)\n\n### Object argument\n\nIf you pass multiple objects to a function, they merge to form a single object:\n\n```js\nfunction hello({ a, b, c }) {\n  a // 1\n  b // 2\n  c // 3\n}\n\nhello({ a: false, b: 2 }, { a: 1, c: 3 })\n```\n\nThough it goes against the pattern, you can pass non-object parameters into a function (see the [`_args` property](#_args-property)).\n\n#### `args` property\n\nThe `args` property of the object argument is a reference to the object argument itself.\n\nThis allows you to use destructuring assignment on the argument while also having a reference to the entire object if needed:\n\n```js\nfunction hello({ args, world }) {\n  world = `hello ${world}`\n  return { ...args, world }\n}\n\nhello({ a: true, world: \"world\" })\n  // { a: true, world: \"hello world\" }\n```\n\nThe `args` property will always overwrite any `args` property that is passed to the function.\n\nThe `args` value does not contain an `args` or `_args` property.\n\n#### `_args` property\n\nThe `_args` property of the object argument is an array of any non-object values that were passed into the function:\n\n```js\nfunction hello({ _args: [ world ] }) {\n  return `hello ${world}`\n}\n\nhello(\"world\")\n  // { value: \"hello world\" }\n```\n\nThe `_args` property will always overwrite any `_args` property that is passed to the function.\n\n#### `promise.resolve` property\n\nThe `promise.resolve` property of the object argument is a function you can call if your function is asynchronous.\n\nThe `promise.resolve` function is similar to the one in `new Promise(function(resolve, reject) { ... })`.\n\nThe resolved asynchronous value is passed along through the [`promise.then` property](#promise.then-property).\n\n#### `promise.reject` property\n\nThe `promise.reject` property of the argument object is a function you can call if your function is asynchronous.\n\nThe `promise.reject` function is similar to the one in `new Promise(function(resolve, reject) { ... })`.\n\nThe rejected asynchronous value is passed along through the [`promise.then` property](#promise.then-property).\n\n### Return value object\n\nThe return value of a function is **always** a single object.\n\n#### `catch` property\n\nThe `catch` property is similar to the one in the Promises/A+ spec.\n\n#### `then` property\n\nThe `then` property is similar to the one in the Promises/A+ spec.\n\nIf a function does a hard return with a promise, `then` will resolve when the promise does.\n\nIf a function does a hard return with a non-promise value, `then` will resolve with that value.\n\nIf a function does not return any value, `then` will resolve when the [resolve](#resolve-property) or [reject](#reject-property) functions are called.\n\n#### `value` property\n\nThe `value` property of the object argument is set to the value of the hard return (if there is one):\n\n```js\nfunction hello() {\n  return \"hello\"\n}\n\nhello()\n  // { value: \"hello\" }\n```\n\nThe `value` property will always overwrite the `value` property of an object that is returned from the function.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvrs%2Fstandard-io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finvrs%2Fstandard-io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvrs%2Fstandard-io/lists"}