New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-riner

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-riner

Rinerは独自のファイルをhtmlに変換し、Expressサーバーで配信します。

latest
npmnpm
Version
2.0.3
Version published
Maintainers
1
Created
Source

Riner Framework (Node Riner)

Rinerは独自のファイルをhtmlに変換し、Expressサーバーで配信します。

インストール

npm i node-riner@latest

特長(主な機能)

  • RinerRideFile(.rd) から HTML を自動生成して Express で配信
  • { ... } 内の JavaScript をサンドボックス実行して動的に値を埋め込み
  • 永続状態管理 riner.state(サーバ側に保存)
  • 永続的に実行される move(riner.move)を登録して state を更新
  • riner.out / riner.move / riner.off / riner.clear をテンプレートから利用可能
  • SSE(Server-Sent Events)で state の変更をクライアントに配信
  • REST API で state / moves の取得・更新が可能

使い方(最小構成)

index.rd(XML)

<Root>
  <Page route="/">
    <Content>
      <h1>Hello</h1>
      <p>{riner.out(new Date().toString())}</p>
    </Content>
  </Page>
</Root>

main.ts

import Riner from 'node-riner'

const app = new Riner('my app')
app.Ride('index.rd')      // XML を読み込む
app.config({ siteName: 'MyBlog' }) // サーバ側既定コンテキスト
app.serve(3000)           // サーバ起動

riner API(テンプレート内で使用)

  • riner.out(...args) — 出力を収集して文字列化して埋め込む
  • riner.move(fn) — 永続的な move を登録(fn は関数。例: () => counter = (counter||0)+1)
  • riner.off(fnOrSrc) — 指定した move を解除(関数かソース文字列で指定)
  • riner.clear() — 全ての move を削除
  • riner.state — サーバ保存の state オブジェクトへ参照

テンプレート例:

<p>{riner.out(counter)}</p>
<p>{riner.move(() => counter = (counter || 0) + 1)}</p>

サーバ側 API / SSE

  • GET /__riner/state — 現在の riner.state を返す(JSON)
  • POST /__riner/state — JSON を送って state をマージ
  • GET /__riner/moves — 登録中の move 一覧を返す
  • POST /__riner/moves — { source: "function source" } で move 登録
  • DELETE /__riner/moves — { source: "function source" } で move 削除
  • SSE /__riner/events — state 更新を受け取る(リアルタイム)

注意(セキュリティ)

  • テンプレート内の { ... } はサンドボックス(vm)で実行しますが、任意コード実行のリスクは完全には無くなりません。
  • 外部入力や未信頼のテンプレートを評価しないでください。プロダクションでは追加の制限・監査が必須です。

例: Test.rd(サンプル)

<Root>
  <Page route="/">
    <Content>
      <h1>My Blog</h1>
      <p>{riner.out(new Date().toString())}</p>
      <p>訪問回数: {riner.out(counter)}</p>
    </Content>
  </Page>
</Root>

FAQs

Package last updated on 14 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts