Alethic.Node.AspNet
1.0.1-pre.25
See the version list below for details.
dotnet add package Alethic.Node.AspNet --version 1.0.1-pre.25
NuGet\Install-Package Alethic.Node.AspNet -Version 1.0.1-pre.25
<PackageReference Include="Alethic.Node.AspNet" Version="1.0.1-pre.25" />
<PackageVersion Include="Alethic.Node.AspNet" Version="1.0.1-pre.25" />
<PackageReference Include="Alethic.Node.AspNet" />
paket add Alethic.Node.AspNet --version 1.0.1-pre.25
#r "nuget: Alethic.Node.AspNet, 1.0.1-pre.25"
#:package Alethic.Node.AspNet@1.0.1-pre.25
#addin nuget:?package=Alethic.Node.AspNet&version=1.0.1-pre.25&prerelease
#tool nuget:?package=Alethic.Node.AspNet&version=1.0.1-pre.25&prerelease
Alethic.Node.AspNet
Node.js in an ASP.NET (System.Web) application on .NET Framework, over Alethic.Node's pool: a pool that needs no container, work done for a request from the engine's thread, JavaScript that fetches from the site it runs in, and an application's pages served from System.Web routes. For components on Web Forms pages, see Alethic.Node.AspNet.Components.
dotnet add package Alethic.Node.AspNet
dotnet add package Microsoft.JavaScript.LibNode.win-x64
The pool
AspNetNode.Pool works with no setup: one engine. To change it, the alethic.node section in web.config:
<configSections>
<section name="alethic.node" type="Alethic.Node.AspNet.NodeSection, Alethic.Node.AspNet" />
</configSections>
<alethic.node engineCount="2" maxConcurrencyPerEngine="4" acquireTimeout="00:00:10" />
A site with a container supplies its own pool, with every option, through HttpRuntime.WebObjectActivator.
Work for a request
var request = new NodeRequest(Context);
var html = await request.RunAsync(module, async exports =>
(string)await ((JSPromise)request.Call(exports["render"], exports, props)).AsTask());
The work runs on an engine's thread. What it needs done as the request, with HttpContext.Current in place, it hands
back with request.InvokeAsync(...), and the request's thread does it. RunAsync is for an Async="true" page;
Run blocks, for one that is not.
JavaScript called through request.Call can fetch the site, and the request answers it in process as the visitor,
through the site's own handler for the path: GET and HEAD, cookies, a text response.
Pages from a fetch handler
protected void Application_Start(object sender, EventArgs e)
{
var app = new FetchRequestHandler(NodeModuleSource.FromFile(HostingEnvironment.MapPath("~/App_Data/app/app.cjs")));
RouteTable.Routes.MapNode("about", app);
RouteTable.Routes.MapNode("parks/{parkRef}", app);
}
The application is a CommonJS bundle whose default export has a fetch(request, env, ctx) function;
Alethic.Node.Http says what it sees, and the same bundle serves
from ASP.NET Core. Its response is the site's, status included. Requests no route matches go on to the site's pages;
a catch-all route needs RouteTable.Routes.Ignore("{resource}.axd/{*pathInfo}") ahead of it.
One Node per process
ASP.NET restarts an application in a new AppDomain of the same process, where Node cannot start again. Keep the site
from restarting in place (<httpRuntime fcnMode="Disabled" />) and recycle the application pool to deploy.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.2
- Alethic.Node.Http (>= 1.0.1-pre.25)
- System.Threading.Channels (>= 9.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Alethic.Node.AspNet:
| Package | Downloads |
|---|---|
|
Alethic.Node.AspNet.Components
JavaScript components hosted on ASP.NET Web Forms pages: a Component control whose props are set in markup and code and kept in view state, whose callbacks raise server commands, and which renders on the server on Node embedded in the worker process, through two functions the site's own client provides. |
|
|
Alethic.AspNet.Optimization.Rollup
System.Web.Optimization bundles built by Rollup, Sass, SWC, Terser and Lightning CSS, running in the site's own Node engines through Alethic.Node. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.1-pre.27 | 61 | 10/4/2026 |
| 1.0.1-pre.25 | 62 | 10/4/2026 |
| 1.0.0 | 118 | 10/3/2026 |
| 1.0.0-pre.37 | 74 | 10/3/2026 |
| 1.0.0-pre.34 | 65 | 10/3/2026 |
| 1.0.0-pre.14 | 60 | 10/3/2026 |