Scan your whole stack
Are you using @marko/run?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.11.20
@marko/run was last scanned on 1 Dec 2026 at version 0.11.20. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.11.20 LATEST | 1 Dec 2026 | No rules fired |
| 0.11.19 | 20 Nov 2026 | No rules fired |
| 0.11.18 | 18 Nov 2026 | No rules fired |
| 0.11.17 | 6 Nov 2026 | Not shown |
| 0.11.16 | 20 Oct 2026 | Not shown |
Findings for v0.11.20. 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.11.20; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
And when you build your production-ready app:
Warning This project is in BETA - use at your own peril, but please do provide helpful feedback.
npm install @marko/run
marko-run makes it easy to get started without little to no config. The package ships with a default Vite config and node-based adapter.
To get started from a template:
npm init marko -- -t basiccd ./<PROJECT_NAME>npm run devOr manually create a project:
@marko/runsrc/routes/+page.markonpm exec marko-runFinally open http://localhost:3000 🚀
dev - Start a development server in watch mode
> npm exec marko-run
or (with explicit sub command)
> npm exec marko-run dev
build - Create a production build
> npm exec marko-run build
preview - Create a production build and start the preview server
> npm exec marko-run preview
The plugin looks for route files in the configured routes directory. By default, that’s ./src/routes, relative to the Vite config file.
To change what directory routes are found in:
// vite.config.ts
import { defineConfig } from "vite";
import marko from "@marko/run/vite";
export default defineConfig({
plugins: [
marko({
routesDir: "src/pages", // Use `./src/pages` (relative to this file) as the routes directory
}),
],
});
The router only recognizes certain filenames which are all prefixed with + (Why?). The following filenames will be discovered in any directory inside your application’s routes directory.
+page.markoThese files establish a route at the current directory path which will be served for GET requests with the HTML content of the page. Only one page may exist for any served path.
+layout.markoThese files provide a layout component, which will wrap all nested layouts and pages.
Layouts are like any other Marko component, with no extra constraints. Each layout receives the request, path params, URL, and route metadata as input, as well as a renderBody which refers to the nested page that is being rendered.
<main>
<h1>My Products</h1>
<${input.renderBody}/> // render the page or layout here
</main>
+handler.*These files establish a route at the current directory path which can handle requests for any HTTP method — export functions named GET, HEAD, POST, PUT, DELETE, PATCH, OPTIONS, or QUERY.
Typically, these will be .js or .ts files depending on your project. Like pages, only one handler may exist for any served path.
Handlers are created with the global Run namespace's verb helpers (Run.GET, Run.POST, etc.) which add request validation, typed bodies, and data loading:
export const POST = Run.POST(async (context, next) => {
const { request, params, url, meta } = context;
return new Response("Successfully updated", { status: 200 });
});
Valid exports are named GET, HEAD, POST, PUT, DELETE, PATCH, OPTIONS, QUERY.
Exports can be one of the following
Run verb helperHandler functions are synchronous or asynchronous functions that
Receives a context and next argument,
context argument contains the WHATWG request object, path parameters, URL, and route metadata.next argument will render the page for GET, HEAD, and POST requests where applicable or return a 204 response. Pass it an object to make data available to downstream handlers and the page.Return a WHATWG response, throw a WHATWG response, or return undefined. If the function returns undefined the next argument will be automatically called and used as the response.
export function POST(context, next) {
const { request, params, url, meta } = context;
return new Response("Successfully updated", { status: 200 });
}
export function PUT(context, next) {
// `next` will be called for you by the runtime
}
export async function GET(context, next) {
// do something before calling `next`
const response = await next();
// do something with the response from `next`
return response;
}
export function DELETE(context, next) {
return new Response("Successfully removed", { status: 204 });
}
+middleware.*These files are like layouts, but for handlers. Middleware files are called before handlers and let you perform arbitrary work before and after.
Note: Unlike handlers, middleware run for all HTTP methods. Middleware created with
Run.ALL(...)also runs for every method, while middleware created with a specific verb helper (e.g.Run.POST(...)) is skipped for other methods.
Expects a default export that can be one of the following
Run.ALL or a Run verb helperRun.ALL({ search: ... }), to attach validation for every route below without adding behaviorHandler functions are synchronous or asynchronous functions that
Receives a context and next argument,
context argument contains the WHATWG request object, path parameters, URL, and route metadata.next argument will call the page for GET requests where applicable or return a 204 response.Return a WHATWG response, throw a WHATWG response, or return undefined. If the function returns undefined the next argument will be automatically called and used as the response.
export default async function (context, next) {
const requestName = `${context.request.method} ${context.url.href}`;
let success = true;
console.log(`${requestName} request started`);
try {
return await next(); // Wait for subsequent middleware, handler, and page
} catch (err) {
success = false;
throw err;
} finally {
console.log(
`${requestName} completed ${success ? "successfully" : "with errors"}`,
);
}
}
+meta.*These files represent static metadata to attach to the route. This metadata will be automatically provided on the route context when invoking a route. When the file is a non-JSON file, the default export will be used.
Meta data supports verb-specific overrides when it is an object (eg. a JSON file or export default { ... }). Top-level keys that match one of GET, HEAD, POST, PUT, DELETE, PATCH, OPTIONS or QUERY will be merged in shallowly to the base object and override any existing values for routes of the method. These keys will also be excluded from the base object and ignored if not an object. For example given a +meta.json file:
{
"name": "Default Name",
"POST": {
"name": "Post Name",
"postOnlyData": "foo"
},
"GET": {
"name": "Get Name"
},
"PUT": "Ignored"
}
when making a POST request the value of context.meta will be
{
name: "Post Name",
portOnlyData: "foo"
}
and the value for a GET request will be
{
name: "Get Name";
}
all other methods, including PUT, will be the base object
{
name: "Default Name";
}
In addition to the files above which can be defined in any directory under the routes directory, some special files can only be defined at its top level.
These special pages are subject to a root layout file (pages/+layout.marko in the default configuration).
+404.markoThis special page responds to any request where:
Accept request header includes text/htmlResponses with this page will have a 404 status code.
+500.markoThis special page responds to any request where:
Accept request header includes text/htmlResponses with this page will have a 500 status code.
Given the following routes directory structure
When the path /about is requested, the routable files execute in the following order:
sequenceDiagram
participant MW1 as routes/+middleware.js
participant MW2 as routes/about/+middleware.js
participant H as routes/about/+handler.js
participant L1 as routes/+layout.marko
participant L2 as routes/about/+layout.marko
participant P as routes/about/+page.marko
Note over L1,P: Combined at build-time as a single component
MW1->>MW2: next()
MW2->>H: next()
H->>L1: next()
L1->L2: ${input.renderBody}
L2->P: ${input.renderBody}
L1-->>H: Stream Response
H-->>MW2: Response
MW2-->>MW1: Response
Within the routes directory, the directory structure determines the path from which the route is served. There are four types of directory names: static, pathless, dynamic, and catch-all.
Static directories - The most common type, and the default behavior. Each static directory contributes its name as a segment in the route's served path, like a traditional fileserver. Unless a directory name matches the requirements for one of the below types, it is seen as a static directory.
Examples:
/foo
/users
/projects
Pathless directories - These directories do not contribute their name to the route's served path. Directory names that start with an underscore (_) will be ignored when parsing the route.
Examples:
/_users
/_public
Dynamic directories - These directories introduce a dynamic parameter to the route's served path and will match any value at that segment. Any directory name that starts with a single dollar sign ($) will be a dynamic directory, and the remaining directory name will be the parameter at runtime. If the directory name is exactly $, the parameter will not be captured but it will be matched.
Examples:
/$id
/$name
/$
Catch-all directories - These directories are similar to dynamic directories and introduce a dynamic parameter, but instead of matching a single path segment, they match to the end of the path. Any directory that starts with two dollar signs ($$) will be a catch-all directory, and the remaining directory name will be the parameter at runtime. In the case of a directory named $$, the parameter name will not be captured but it will match. Catch-all directories can be used to make 404 Not Found routes at any level, including the root.
Because catch-all directories match any path segment and consume the rest of the path, you cannot nest route files in them and no further directories will be traversed.
Examples:
/$$all
/$$rest
/$$
Flat routes let you define paths without needing additional folders. Instead the folder structure can be defined either in the file or folder name. This allows you to decouple your routes from your folder structure or co-locate them as needed. To define a flat route, use periods (.) to delineate each path segment. This behaves exactly like creating a new folder and each segment will be parsed using the rules described above for static, dynamic and pathless routes.
Flat routes syntax can be used for both directories and routable files (eg. pages, handlers, middleware, etc.). For these files, anything preceding the plus (+) will be treated as the flat route.
For example to define a page at /projects/$projectId/members with a root layout and a project layout:
Without flat routes you would have a file structure like:
routes/
projects/
$projectId/
members/
+page.marko
+layout.marko
+layout.marko
With flat routes move the path defined by the folders into the files and separate with a period
routes/
+layout.marko
projects+layout.marko
projects.$projectId.members+page.marko
Additionally, you can continue to organize files under folders to decrease duplication and use flat route syntax in the folder name
routes/
projects.$projectId/
+layout.marko
members+page.marko
+layout.marko
Finally, flat routes and routes defined with directories are all treated equally and merged together. For example this page will have layout
routes/
projects/
$projectId/
+layout.marko
projects.$projectId+page.marko
Along with describing multiple segments, flat route syntax supports defining routes that match more than one path and segments that are optional. To describe a route that matches multiple paths, use a comma (,) and define each route.
For example the following page matches /projects/$projectId/members and /projects/$projectId/people
routes/
projects.$projectId.members,projects.$projectId.people+page.marko
This file name is a bit long so you might do something like this
routes/
projects.$projectId
members,people+page.marko
We can simplify this by introducing another concept: grouping. Groups allows you to define segments within a flat route that match multiple sub-paths by surrounding them with parentheses (( and )). For the example, this means you can do the following:
routes/
projects.$projectId.(members,people)+page.marko
This is a simple example of grouping but you can nest groups and make them as complicated as you want.
The last concept is optionality. By introducing an empty segment or pathless segment along with another value you can make that segment optional. For example, If we want a page that matches /projects and /projects/home, you can create a flat route that optionally matches home
routes/
projects.(home,)+page.marko
or
routes/
projects.(home,_pathless)+page.marko
While both of these create a route which matches the paths, they have slightly different semantics. Using a pathless segment is the same as creating a pathless folder which allows you to isolate middleware and layouts. Using an empty segment is the same as defining a file at the current location.
To include a control character (.,+()$_) as a literal in a route path, it can be surrounded with graves (`). For example to create a route to /sitemap.xml
routes/
`sitemap.xml`/
+handler.ts
or
routes/
sitemap`.`xml
+handler.ts
or
routes/
sitemap`.`xml+handler.ts
Route handler and middleware are written using the verb helpers defined on the global Run namespace which allows for typed request bodies, and typed data loading.
Each verb helper (Run.GET, Run.HEAD, Run.POST, Run.PUT, Run.DELETE, Run.PATCH, Run.OPTIONS, Run.QUERY, and Run.ALL) accepts:
Run.POST(handler); // a handler function
Run.POST([mw, handler]); // an array of handlers, composed in order
Run.POST(options, handler); // validation options plus a handler (or array)
Run.POST(options); // options only — validates and passes through 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.
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).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.