npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@loutrejs/node

v0.10.1

Published

Loutre ApplicationをNode.jsで起動するRuntime Adapterです。HTTP serverへの接続と、HTTPを持たないworkerのApplication lifecycleを管理します。

Readme

@loutrejs/node

Loutre ApplicationをNode.jsで起動するRuntime Adapterです。HTTP serverへの接続と、HTTPを持たないworkerのApplication lifecycleを管理します。

Node.js 22以上を対象にしています。

Install

npm install @loutrejs/loutre @loutrejs/node

Usage

import { nodeRuntime } from '@loutrejs/node'
import application from './app.js'

const app = await nodeRuntime.create({ application })
const server = await app.serve({ port: 3000 })

console.log(server.port)
await app.close()

create()はApplicationをinitializeしてRuntime Application Contextを返します。SIGINT / SIGTERMのshutdown hookを標準で登録します。app.serve()がHTTP listenerを開始し、app.close()がlistenerとApplication lifecycleをまとめて終了します。

HTTPを持たないworker

TaskやQueueを持つApplicationもnodeRuntime.create({ application })で起動できます。serve()を呼ぶ必要はありません。

SIGINT / SIGTERMを受けるとapp.close(signal)を実行し、Task・Queueの停止と終了lifecycleへsignalを渡します。手動のclose()でもsignal handlerを解除します。終了失敗はApplicationのLoggerへerrorとsignalを記録し、手動のclose()では例外として返します。終了を開始したApplicationは、close()が失敗してもserve()で再開できません。lifecycle失敗後もlistenerとDevtools transportを回収し、エラーを集約します。drainが安全なcleanup境界に到達できない場合は、受付を停止したまま既存executionを保持し、完了後にclose()を再試行できます。

Runtimeはprocess.exit()を呼ばないため、利用側で作成したtimerや外部resourceは終了lifecycleで解放してください。

埋め込み用途やテストではnodeRuntime.create({ application, shutdownHooks: false })で無効にできます。既存のserve({ shutdownHooks })は指定時に設定を上書きし、省略時はcreate()の設定を維持します。

Port selection

portを明示した場合は、そのportでlistenできなければerrorになります。

const app = await nodeRuntime.create({ application })
await app.serve({ port: 8080 })

portを省略した場合は3000から利用可能なportを探します。

const app = await nodeRuntime.create({ application })
const server = await app.serve()
console.log(server.port)

Options

| Option | Description | | ---------------------- | ------------------------------------------- | | create.application | Loutre Application | | create.environment | Applicationへ渡すEnvironment source | | create.shutdownHooks | SIGINT / SIGTERM hookの有効化。標準はtrue | | create.arguments | Applicationへ渡すArguments | | serve.port | listenするport。省略時は3000から探索 | | serve.hostname | listenするhostname | | serve.shutdownHooks | shutdown hook設定の上書き。省略時は維持 |

Documentation

License

MIT