{"id":13526731,"url":"https://github.com/thenables/thenify","last_synced_at":"2025-10-08T01:18:00.262Z","repository":{"id":24712023,"uuid":"28123746","full_name":"thenables/thenify","owner":"thenables","description":"Promisify a callback-based function","archived":false,"fork":false,"pushed_at":"2020-10-25T09:01:40.000Z","size":21,"stargazers_count":109,"open_issues_count":2,"forks_count":19,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-29T00:28:35.141Z","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/thenables.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","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":"2014-12-17T06:05:12.000Z","updated_at":"2025-02-01T16:37:23.000Z","dependencies_parsed_at":"2022-07-27T04:46:42.686Z","dependency_job_id":null,"html_url":"https://github.com/thenables/thenify","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/thenables/thenify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenables%2Fthenify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenables%2Fthenify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenables%2Fthenify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenables%2Fthenify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thenables","download_url":"https://codeload.github.com/thenables/thenify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenables%2Fthenify/sbom","scorecard":{"id":879370,"data":{"date":"2025-08-11","repo":{"name":"github.com/thenables/thenify","commit":"b81f5a29e7f642c0999910a13406bdf387b2855c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"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":"Code-Review","score":2,"reason":"Found 7/30 approved changesets -- score normalized to 2","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":"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T07:28:10.681Z","repository_id":24712023,"created_at":"2025-08-24T07:28:10.681Z","updated_at":"2025-08-24T07:28:10.681Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278266896,"owners_count":25958733,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"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-08-01T06:01:33.840Z","updated_at":"2025-10-08T01:18:00.242Z","avatar_url":"https://github.com/thenables.png","language":"JavaScript","readme":"\n# thenify\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![Dependency Status][david-image]][david-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\nPromisify a callback-based function using [`any-promise`](https://github.com/kevinbeaty/any-promise).\n\n- Preserves function names\n- Uses a native promise implementation if available and tries to fall back to a promise implementation such as `bluebird`\n- Converts multiple arguments from the callback into an `Array`, also support change the behavior by `options.multiArgs`\n- Resulting function never deoptimizes\n- Supports both callback and promise style\n\nAn added benefit is that `throw`n errors in that async function will be caught by the promise!\n\n## API\n\n### fn = thenify(fn, options)\n\nPromisifies a function.\n\n### Options\n\n`options` are optional.\n\n- `options.withCallback` - support both callback and promise style, default to `false`.\n- `options.multiArgs` - change the behavior when callback have multiple arguments. default to `true`.\n  - `true` - converts multiple arguments to an array\n  - `false`- always use the first argument\n  - `Array` - converts multiple arguments to an object with keys provided in `options.multiArgs`\n\n- Turn async functions into promises\n\n```js\nvar thenify = require('thenify');\n\nvar somethingAsync = thenify(function somethingAsync(a, b, c, callback) {\n  callback(null, a, b, c);\n});\n```\n\n- Backward compatible with callback\n\n```js\nvar thenify = require('thenify');\n\nvar somethingAsync = thenify(function somethingAsync(a, b, c, callback) {\n  callback(null, a, b, c);\n}, { withCallback: true });\n\n// somethingAsync(a, b, c).then(onFulfilled).catch(onRejected);\n// somethingAsync(a, b, c, function () {});\n```\n\nor use `thenify.withCallback()`\n\n```js\nvar thenify = require('thenify').withCallback;\n\nvar somethingAsync = thenify(function somethingAsync(a, b, c, callback) {\n  callback(null, a, b, c);\n});\n\n// somethingAsync(a, b, c).then(onFulfilled).catch(onRejected);\n// somethingAsync(a, b, c, function () {});\n```\n\n- Always return the first argument in callback\n\n```js\nvar thenify = require('thenify');\n\nvar promise = thenify(function (callback) {\n  callback(null, 1, 2, 3);\n}, { multiArgs: false });\n\n// promise().then(function onFulfilled(value) {\n//   assert.equal(value, 1);\n// });\n```\n\n- Converts callback arguments to an object\n\n```js\nvar thenify = require('thenify');\n\nvar promise = thenify(function (callback) {\n  callback(null, 1, 2, 3);\n}, { multiArgs: [ 'one', 'tow', 'three' ] });\n\n// promise().then(function onFulfilled(value) {\n//   assert.deepEqual(value, {\n//     one: 1,\n//     tow: 2,\n//     three: 3\n//   });\n// });\n```\n\n[gitter-image]: https://badges.gitter.im/thenables/thenify.png\n[gitter-url]: https://gitter.im/thenables/thenify\n[npm-image]: https://img.shields.io/npm/v/thenify.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/thenify\n[github-tag]: http://img.shields.io/github/tag/thenables/thenify.svg?style=flat-square\n[github-url]: https://github.com/thenables/thenify/tags\n[travis-image]: https://img.shields.io/travis/thenables/thenify.svg?style=flat-square\n[travis-url]: https://travis-ci.org/thenables/thenify\n[coveralls-image]: https://img.shields.io/coveralls/thenables/thenify.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/thenables/thenify\n[david-image]: http://img.shields.io/david/thenables/thenify.svg?style=flat-square\n[david-url]: https://david-dm.org/thenables/thenify\n[license-image]: http://img.shields.io/npm/l/thenify.svg?style=flat-square\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/thenify.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/thenify\n","funding_links":[],"categories":["Repository"],"sub_categories":["Control flow"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenables%2Fthenify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthenables%2Fthenify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenables%2Fthenify/lists"}