Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@effected/templates

Latest version: v0.20.1

Overview

Last scanned
28 Nov 2026
Published
28 Nov 2026
npm package Publisher: spencerbeggs
8 Stars
2 Forks
23 Versions
5.3K Downloads
TypeScript Repo language

Scan summary

@effected/templates was last scanned on 28 Nov 2026 at version 0.20.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 23 versions; the latest was published on 28 Nov 2026.
  • Findings: No rules fired in version 0.20.1.
  • Downloads: 5,331 downloads.

Versions

23 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.20.1 LATEST 28 Nov 2026 No rules fired
0.20.0 10 Nov 2026 No rules fired
0.19.1 10 Nov 2026 No rules fired
0.19.0 8 Nov 2026 Not shown
0.18.0 5 Nov 2026 Not shown

No rules fired in 0.20.1

Findings

Findings for v0.20.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.20.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@effected/templates

npm License: MIT Node.js %3E%3D24.11.0 TypeScript 7.0

Managed sections: delimited BEGIN/END blocks inside files whose surrounding content belongs to the user. A tool owns the block, the user owns everything else, and neither destroys the other — the mechanism behind a generated hook, a managed config fragment, or any file your tool and your user both need to edit.

Pre-1.0.0. This package is part of the @effected/* kit, built on stable Effect v4 (effect ~4.1.0) and still in 0.x development. Stable Effect makes a kit 1.0.0 possible, not automatic. To keep your effect and @effect/* versions on the line the kit is built and tested against, install @effected/pnpm-plugin-effected.

Stability: unstable. This package's API surface is not yet considered complete and may change across 0.x releases. Pin an exact version — even a package marked stable before 1.0.0 can introduce a breaking change by accident, and an exact pin turns that into a type-check error rather than a runtime surprise. Full policy: release strategy.

Why @effected/templates

Most "managed section" implementations put the whole algorithm inside a service that also does file IO, so the hardest logic — deciding what changed, and where a new block belongs — can only be tested by writing files to disk. This package splits the two apart. SectionDocument is a pure string-to-string core with no Effect, no IO and no runtime: parse a document, compare a declared section against what is already there, reconcile a whole set of them, render the result. ManagedSection is a thin service that reads a file, calls the pure core, and writes back only when the text actually changed.

Ambiguity fails typed rather than being resolved by guessing: an unterminated marker, an orphaned END, two overlapping sections, or the same identity declared twice are all a typed SectionParseError naming the line, never a silent skip that leaves a duplicate block on the next run. Line endings are a first-class invariant too — the document's dominant EOL is detected at parse and every comparison is EOL-normalized, so a CRLF file does not report drift forever.

Install

npm install @effected/templates effect
pnpm add @effected/templates effect

Requires Node.js >=24.11.0. effect v4 is the only peer dependency. @effected/files comes along as an ordinary dependency, and it backs the atomic write.

All @effected/* packages are ESM-only: the exports maps publish only import conditions, so require() — including tools that resolve in CJS mode — fails with Node's ERR_PACKAGE_PATH_NOT_EXPORTED rather than loading a CJS build that does not exist. Import from an ES module.

FileSystem comes from effect core, not from a platform package, so a consumer provides it once at the edge (NodeFileSystem.layer from @effect/platform-node on Node). Path is required as well (NodePath.layer on Node): a sync replaces the file through a temp file beside it and a rename, so a crash cannot leave a truncated file.

Quick start

Declare two sections and sync them into a file in one call. Declared order becomes file order, so base always precedes tool, however a user may have reordered the file by hand:

import { CommentStyle, ManagedSection, SectionId } from "@effected/templates";
import * as NodeFileSystem from "@effect/platform-node/NodeFileSystem";
import * as NodePath from "@effect/platform-node/NodePath";
import { Effect, Layer } from "effect";

const Base = SectionId.make({ key: "base", commentStyle: CommentStyle.hash });
const Tool = SectionId.make({ key: "tool", commentStyle: CommentStyle.hash });

const program = Effect.gen(function* () {
  const sections = yield* ManagedSection;
  return yield* sections.syncAll(".husky/pre-commit", [Base.section("#!/usr/bin/env sh"), Tool.section("npx tool run")]);
});

Effect.runPromise(program.pipe(Effect.provide(ManagedSection.layer), Effect.provide(Layer.mergeAll(NodeFileSystem.layer, NodePath.layer)))).then((outcomes) =>
  console.log(outcomes.map((o) => o._tag)),
);
// example output on a fresh file: [ "Created", "Created" ]
// example output on a second, identical run: [ "Unchanged", "Unchanged" ]

Marker attributes

A BEGIN marker can carry name="value" pairs, so a tool reads a block's provenance — which run wrote it, and when — off the marker line without opening the block:

import { CommentStyle, SectionDocument, SectionId } from "@effected/templates";
import { Result } from "effect";

const Tool = SectionId.make({ key: "tool", commentStyle: CommentStyle.hash });
const doc = SectionDocument.parseResult("#!/usr/bin/env sh\n");

if (Result.isSuccess(doc)) {
  const next = doc.success.reconcile([Tool.section("npx tool run", { origin: "ci", runId: "1873" })]);
  console.log(Result.isSuccess(next) ? next.success.text : next.failure.message);
  // #!/usr/bin/env sh
  //
  // # --- BEGIN tool MANAGED SECTION origin="ci" runId="1873" ---
  // npx tool run
  // # --- END tool MANAGED SECTION ---
}

Attributes are metadata, never identity: a section is found by key and comment style alone, so bumping runId updates that block in place instead of orphaning it and appending a second one. They do count as difference — check answers Drifted when a declared attribute disagrees with the marker on disk, which is what lets a tool rewrite a block whose only change is its metadata. Omitting the argument and passing {} are the same section, so a caller that never uses attributes sees no drift against a bare marker.

The grammar has no escaping, deliberately: names match [A-Za-z][A-Za-z0-9_-]*, values are double-quoted and carry neither " nor a line break, and anything outside that fails typed as a SectionRenderError with reason: "invalidAttribute" naming the attribute — before a byte is written. An END marker never carries attributes, and an attribute run that does not parse cleanly (a mangled pair, one name declared twice) makes the whole line ordinary content rather than a marker.

Attributed markers are a one-way compatibility break: a scanner predating this feature does not recognize one at all, so the block it opens stops being a managed section for that tool. Writing attributes into a file another tool also manages is a decision, not a detail.

Features

  • SectionDocument — the pure core: parse / read / has / check / reconcile / remove over a plain string, with no Effect, no IO and no runtime needed to test it.
  • ManagedSection — the service: read, readAll, isManaged, sync, syncAll, check, checkAll and remove, each writing back only when the text changed.
  • CommentStyle — an open set of {prefix, suffix?} presets (hash, slash, semicolon, dash, html, block) covering both line comments and wrapped ones like <!-- … -->, so a managed section can live in Markdown or HTML, not just source files.
  • Marker attributes — name="value" pairs on a BEGIN marker, via SectionId.section(content, attributes) and Section.attributes: metadata for the tool, never part of a section's identity.
  • SyncOutcome / CheckOutcome — tagged results (Created / Updated / Unchanged, Absent / UpToDate / Drifted) that carry the sections involved rather than a diff, so a caller renders exactly the comparison it needs.
  • Byte-preserving outside managed blocks: every character outside a declared section's span survives a sync, in order, including a leading BOM.
  • Idempotent by construction: syncing an already-up-to-date document writes nothing and touches no mtime.

License

MIT

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @effected/templates

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Frame 2085668439 (1)
Group 1261154229