{"id":19560681,"url":"https://github.com/zoubin/resolve-and-call","last_synced_at":"2026-06-19T10:31:14.581Z","repository":{"id":57354660,"uuid":"43114206","full_name":"zoubin/resolve-and-call","owner":"zoubin","description":"Resolve a module and call the function it exports","archived":false,"fork":false,"pushed_at":"2015-10-01T14:16:04.000Z","size":164,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-17T22:50:32.324Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoubin.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2015-09-25T06:44:44.000Z","updated_at":"2015-10-01T14:06:24.000Z","dependencies_parsed_at":"2022-09-12T06:01:28.830Z","dependency_job_id":null,"html_url":"https://github.com/zoubin/resolve-and-call","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zoubin/resolve-and-call","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fresolve-and-call","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fresolve-and-call/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fresolve-and-call/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fresolve-and-call/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoubin","download_url":"https://codeload.github.com/zoubin/resolve-and-call/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fresolve-and-call/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34528134,"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-19T02:00:06.005Z","response_time":61,"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-11T05:08:27.558Z","updated_at":"2026-06-19T10:31:14.555Z","avatar_url":"https://github.com/zoubin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# resolve-and-call [![Build Status](https://travis-ci.org/zoubin/resolve-and-call.svg?branch=master)](https://travis-ci.org/zoubin/resolve-and-call)\nResolve a module and call the function it exports.\n\n## example\n\n```\n⌘ tree example/\nexample/\n├── call.js\n├── lib\n│   └── subtract\n│       └── index.js\n└── node_modules\n    └── add\n        └── index.js\n```\n\n`call.js`:\n\n```javascript\nvar call = require('..');\n\nconsole.log(\n  'Expect: 3',\n  '\\n',\n  'Actual: ',\n  call('add', 1, 2)\n);\n\nconsole.log(\n  'Expect: 1',\n  '\\n',\n  'Actual: ',\n  call({ basedir: __dirname + '/lib' }, './subtract', 2, 1)\n);\n\n```\n\noutput:\n\n```\n⌘ node example/call.js\nExpect: 3\n Actual:  3\nExpect: 1\n Actual:  1\n```\n\n## res = call([opts, ]fn, arg,...)\n\n### opts\n\nType: `Object`\n\nPassed to [resolve](https://github.com/substack/node-resolve).\n\n### fn\n\nType: `Function`, `String`\n\nThe function to be called.\n\nIf `String`, it will be resolved to the path of a module,\nwhich exports the function to be called.\n\n### args\n\nAll arguments that follow `fn` will be passed to `fn` when it is called.\n\n### res\n\nThe result of calling `fn`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fresolve-and-call","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoubin%2Fresolve-and-call","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fresolve-and-call/lists"}