{"id":28665561,"url":"https://github.com/colonelbundy/nodebridge","last_synced_at":"2025-06-13T13:40:02.098Z","repository":{"id":38138299,"uuid":"197660281","full_name":"ColonelBundy/Nodebridge","owner":"ColonelBundy","description":"Bridge between .net standard and node.js for pre/server side rendering or node specific tasks.","archived":false,"fork":false,"pushed_at":"2023-01-07T07:57:42.000Z","size":510,"stargazers_count":4,"open_issues_count":12,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-08-06T06:52:48.323Z","etag":null,"topics":["aspnetcore","bridge","netstandard","netstandard20","node","nodeservices-prerendering","server-side-rendering","ssr"],"latest_commit_sha":null,"homepage":"","language":"C#","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/ColonelBundy.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":"2019-07-18T21:37:20.000Z","updated_at":"2020-07-06T11:55:38.000Z","dependencies_parsed_at":"2023-02-06T15:31:02.105Z","dependency_job_id":null,"html_url":"https://github.com/ColonelBundy/Nodebridge","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/ColonelBundy/Nodebridge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColonelBundy%2FNodebridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColonelBundy%2FNodebridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColonelBundy%2FNodebridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColonelBundy%2FNodebridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ColonelBundy","download_url":"https://codeload.github.com/ColonelBundy/Nodebridge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColonelBundy%2FNodebridge/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259654520,"owners_count":22891032,"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":["aspnetcore","bridge","netstandard","netstandard20","node","nodeservices-prerendering","server-side-rendering","ssr"],"created_at":"2025-06-13T13:38:48.434Z","updated_at":"2025-06-13T13:40:02.081Z","avatar_url":"https://github.com/ColonelBundy.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e⛓️ Nodebridge ⛓️\u003c/h1\u003e\n\n[![Nuget Package](https://badgen.net/nuget/v/NodeBridge)](https://www.nuget.org/packages/NodeBridge/)\n\n\u003e Bridge between .net standard 2.0 and node.js for pre/server side rendering or node specific tasks.\n\n## ❔ Why use this instead of nodeservices from Microsoft?\n\u003e Nodeservices from microsoft spawn a new process almost every new request. And sometimes in situations where you need to persist the process for configuration purposes or just for plain performance, you can't with nodeservices.\n\u003e Nodeservices also supports streams where I choose to skip that, if that is needed check the implementation [here](https://github.com/aspnet/JavaScriptServices/blob/bc8984693d4ffe215cc741c97772911c60a2f512/src/Microsoft.AspNetCore.NodeServices/HostingModels/HttpNodeInstance.cs#L96) and create a pr.\n\n## 📄 Prerequisites\n* node \u003e= 10.5 (prefer 12.x)\n* .net standard 2.0\n\n## 🚀 Usage\n\n### In Startup -\u003e ConfigureServices \n```C#\n  services.AddNodeBridge(options =\u003e {\n    options.Workingdirectory = \"\"; // Optional: base directory for your node files. Default: Working directory of your project.\n    options.Instances = 1; // Optional: Number of worker threads to spawn. Default: Number of cores of your system.\n    options.Logger = loggerInstance; // Optional: Attach any logger that implements the ILogger interface. Default: standard ILogger.\n    options.Port = 3000; // Optional: Port for the node bridge to listen on. Default: Random port. \n  });\n```\n\n### Usage in controllers\n```C#\n    public class ValuesController : Controller\n    {\n        private readonly Bridge _bridge;\n\n        public ValuesController(Bridge bridge) \n        {\n            _bridge = bridge;\n        }\n\n        public async Task\u003cIActionResult\u003e Index()\n        {\n            // Note!\n            // Any exported function should return a promise.\n            var result = _bridge.Invoke(\"file.js\", \"test\", \"hello\"); // Will invoke function test in file.js with hello as the first argument.\n\n            ViewBag.result = result;\n\n            return View();\n        }\n    }\n```\n\n## 📝 License\n\nCopyright © 2020 [Colonelbundy](https://github.com/ColonelBundy).\u003cbr /\u003e\nThis project is [MIT](https://github.com/ColonelBundy/Nodebridge/blob/master/LICENSE) licensed.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolonelbundy%2Fnodebridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolonelbundy%2Fnodebridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolonelbundy%2Fnodebridge/lists"}