{"id":29189392,"url":"https://github.com/coderaiser/zames","last_synced_at":"2025-07-01T23:07:26.189Z","repository":{"id":57405152,"uuid":"73930080","full_name":"coderaiser/zames","owner":"coderaiser","description":"converts callback-based functions to Promises and apply currying to arguments","archived":false,"fork":false,"pushed_at":"2019-09-20T11:17:06.000Z","size":22,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-15T05:09:23.062Z","etag":null,"topics":["converts-callback","curry","functional","functional-programming","nodejs","promisify"],"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/coderaiser.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-16T14:55:13.000Z","updated_at":"2020-02-23T22:10:21.000Z","dependencies_parsed_at":"2022-09-17T14:42:12.020Z","dependency_job_id":null,"html_url":"https://github.com/coderaiser/zames","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/coderaiser/zames","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fzames","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fzames/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fzames/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fzames/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderaiser","download_url":"https://codeload.github.com/coderaiser/zames/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fzames/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261686578,"owners_count":23194305,"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":["converts-callback","curry","functional","functional-programming","nodejs","promisify"],"created_at":"2025-07-01T23:07:25.342Z","updated_at":"2025-07-01T23:07:26.130Z","avatar_url":"https://github.com/coderaiser.png","language":"JavaScript","readme":"# Zames [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]\n\n`zames` converts callback-based functions to Promises and apply currying to arguments.\n\n`zames` = [currify][currify] + [promisify][promisify].\n\n## Install\n\n`npm i zames --save`\n\n## API\n\n### zames(fn [,ctx])\n\n- `fn` - function\n- `ctx` - context\n\n`zames` can take just a `function`:\n\n```js\nconst zames = require('zames');\n\nconst promise = zames((a, b, fn) =\u003e {\n    fn(null, a + b);\n});\n\nconst add = promise('hello ');\n\nadd('world').then((a) =\u003e {\n    console.log(a);\n    // output\n    'hello world';\n});\n\n```\n\nOr can be used with `ctx` as well:\n\n```js\nconst ctx = {\n    error: 'hello',\n    log: function(a, b, fn) {\n        fn(this.error);\n    }\n}\n\nconst withContext = zames(ctx.log, ctx);\n\nwithContext(1, 2)\n    .catch((e) =\u003e {\n        console.error(e.message);\n        // output\n        'hello';\n    });\n\n```\n\n## Related\n\n- [currify](https://github.com/coderaiser/currify \"currify\") - translate the evaluation of a function that takes multiple arguments into evaluating a sequence of functions, each with a single or more arguments.\n\n- [fullstore](https://github.com/coderaiser/fullstore \"fullstore\") - functional variables.\n\n- [wraptile](https://github.com/coderaiser/wraptile \"wraptile\") - translate the evaluation of a function that takes multiple arguments into evaluating a sequence of 2 functions, each with a any count of arguments.\n\n## License\n\nMIT\n\n[NPMIMGURL]:                https://img.shields.io/npm/v/zames.svg?style=flat\n[BuildStatusIMGURL]:        https://img.shields.io/travis/coderaiser/zames/master.svg?style=flat\n[DependencyStatusIMGURL]:   https://img.shields.io/david/coderaiser/zames.svg?style=flat\n[LicenseIMGURL]:            https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat\n[NPMURL]:                   https://npmjs.org/package/zames \"npm\"\n[BuildStatusURL]:           https://travis-ci.org/coderaiser/zames  \"Build Status\"\n[DependencyStatusURL]:      https://david-dm.org/coderaiser/zames \"Dependency Status\"\n[LicenseURL]:               https://tldrlegal.com/license/mit-license \"MIT License\"\n\n[CoverageURL]:              https://coveralls.io/github/coderaiser/zames?branch=master\n[CoverageIMGURL]:           https://coveralls.io/repos/coderaiser/zames/badge.svg?branch=master\u0026service=github\n\n[currify]:                 https://en.wikipedia.org/wiki/Currying \"Currying\"\n[promisify]:                https://github.com/digitaldesignlabs/es6-promisify \"Promisify\"\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderaiser%2Fzames","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderaiser%2Fzames","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderaiser%2Fzames/lists"}