{"id":19877115,"url":"https://github.com/yehorbk/dataccom","last_synced_at":"2026-06-06T22:31:30.784Z","repository":{"id":57211486,"uuid":"301980382","full_name":"yehorbk/dataccom","owner":"yehorbk","description":"JavaScript library that allows you to build a request to multiple sources, combine responses and transform the result according to a scheme.","archived":false,"fork":false,"pushed_at":"2021-01-11T07:57:20.000Z","size":103,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T23:55:38.633Z","etag":null,"topics":["accomodation","asynchronous","chain","combine","dataccom","javascript","library","query","query-builder","request","scheme"],"latest_commit_sha":null,"homepage":"","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/yehorbk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-07T09:00:01.000Z","updated_at":"2023-03-07T03:51:53.000Z","dependencies_parsed_at":"2022-08-30T12:30:27.141Z","dependency_job_id":null,"html_url":"https://github.com/yehorbk/dataccom","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/yehorbk/dataccom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yehorbk%2Fdataccom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yehorbk%2Fdataccom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yehorbk%2Fdataccom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yehorbk%2Fdataccom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yehorbk","download_url":"https://codeload.github.com/yehorbk/dataccom/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yehorbk%2Fdataccom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34002561,"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-06T02:00:07.033Z","response_time":107,"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":["accomodation","asynchronous","chain","combine","dataccom","javascript","library","query","query-builder","request","scheme"],"created_at":"2024-11-12T16:36:38.483Z","updated_at":"2026-06-06T22:31:30.760Z","avatar_url":"https://github.com/yehorbk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dataccom\n\nJavaScript library that allows you to build a request to multiple sources,\ncombine responses and transform the result according to a scheme.\n\n# Installation\n\nInstall library via npm:\n\n```\n$ npm install dataccom\n```\n\n# Concept\n\nThe main idea is to allow the developer to compose a query to multiple sources,\nretrieve the data and transform it according to the scheme.\n\n# How to Use\n\nFirst of all, you need to open an interface and then you can build a chain of functions with lazy method `fetch`.\nFeel free to pass both simple and asynchronous functions. If you want to apply a scheme, use\nmethod `apply` to pass it. Note, if you call this method multiple times the scheme will\nbe rewrited. Finally, if you ready to get the data - use method `collect` that returns a promise.\n\n```javascript\nconst dataccom = require('dataccom');\n\nconst scheme = {\n  name: String,\n  age: Number,\n  university: String,\n  specialty: String,\n};\n\nconst userId = 10;\n\nconst result = dataccom\n  .chain()\n  .fetch(getUserData, userId)\n  .fetch(getUserEducation, userId)\n  .apply(scheme)\n  .collect();\n\nconsole.log(result);\n\n/*\n  The result is:\n  {\n    name: 'John',\n    age: 20,\n    university: 'Stanford University',\n    specialty: 'Software Engineering'\n  }\n*/\n```\n\n## How to build a scheme\n\nScheme is an object that contains fields names and it types (constructors).\nIt can contain inner objects and arrays. All items of arrays must be of the same type.\nTo specify an array type - use the next syntax:\n\n```javascript\nconst scheme = {\n  faculty: String,\n  specialty: String,\n  students: [String], // Array of Strings\n};\n```\n\nNote, if you want to use a specific constructor (like `User` class) you should pass a function\nthat returns `User` instance, instead of passing `User` type.\n\n# Author\n\n**Yehor Bublyk**: [GitHub](https://github.com/yehorbk) • [Twitter](https://twitter.com/yehorbk)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyehorbk%2Fdataccom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyehorbk%2Fdataccom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyehorbk%2Fdataccom/lists"}