{"id":15382730,"url":"https://github.com/reggi/kinfunction","last_synced_at":"2025-03-17T02:09:02.872Z","repository":{"id":22934273,"uuid":"26283474","full_name":"reggi/kinfunction","owner":"reggi","description":"Run a function as a child process.","archived":false,"fork":false,"pushed_at":"2014-11-06T19:28:40.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T07:52:58.749Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reggi.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":"2014-11-06T18:22:44.000Z","updated_at":"2014-11-06T18:24:14.000Z","dependencies_parsed_at":"2022-08-21T16:50:48.613Z","dependency_job_id":null,"html_url":"https://github.com/reggi/kinfunction","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reggi%2Fkinfunction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reggi%2Fkinfunction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reggi%2Fkinfunction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reggi%2Fkinfunction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reggi","download_url":"https://codeload.github.com/reggi/kinfunction/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243960665,"owners_count":20375104,"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":[],"created_at":"2024-10-01T14:33:54.842Z","updated_at":"2025-03-17T02:09:02.851Z","avatar_url":"https://github.com/reggi.png","language":"JavaScript","readme":"# kinfunction\n\nAllows you to run any function as a child process.\n\n### Install\n\n```\nnpm install kinfunction --save\n```\n\n### Usage\n\n```\nkinfunction(require, args, function, callback);\n```\n\n### Example\n\nHere's an example of one function (`thefifthofnovember`) running twice and logging different a `process.pid` both times it runs. Because the child process doesn't have any access to the globals in this file we pass `\"moment\":\"moment\"` which will `require(\"moment\")` to the variable `moment`. We also pass in the same arguments that the function takes. \n\n[Here's a repo with this example in it.](https://github.com/reggi/play-kinfunction)\n\n```\nvar moment = require(\"moment\");\nvar kinfunction = require(\"kinfunction\")\n\nvar thefifthofnovember = function(slogan, date) {\n  var day = moment(new Date(date)).format(\"dddd\");\n  return slogan + \" \" + day + \" \" + process.pid;\n}\n\nvar output = thefifthofnovember(\"remember remember\", \"Nov 5 2014\");\nconsole.log(output); // \"remember remember Wednesday 5621\"\n\nkinfunction({\n  \"moment\": \"moment\"\n}, {\n  \"slogan\": \"remember remember\",\n  \"date\": \"Nov 5 2014\",\n}, thefifthofnovember, function(err, result) {\n  if (err) console.log(err);\n  console.log(result); // \"remember remember Wednesday 5622\"\n});\n\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freggi%2Fkinfunction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freggi%2Fkinfunction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freggi%2Fkinfunction/lists"}