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

functype-os

Latest version: v2.2.0

Overview

Last scanned
24 Nov 2026
Published
24 Nov 2026
npm package Publisher: jordanburke
10 Stars
1 Forks
26 Versions
7.3K Downloads
TypeScript Repo language

Scan summary

functype-os was last scanned on 24 Nov 2026 at version 2.2.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 26 versions; the latest 4 were published within 5 days (20–24 Nov 2026).
  • Findings: No rules fired in version 2.2.0.
  • Downloads: 7,348 downloads.

Versions

26 versions published
Versions and the rules that fired in each
VersionPublishedStatus
2.2.0 LATEST 24 Nov 2026 No rules fired
2.1.0 23 Nov 2026 No rules fired
2.0.0 22 Nov 2026 No rules fired
1.27.1 20 Nov 2026 Not shown
1.26.1 14 Nov 2026 Not shown

No rules fired in 2.2.0

Findings

Findings for v2.2.0. 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 2.2.0; other versions have their own rules, not their own score.

README

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

functype-os

Functional OS utilities for Node.js using functype data structures. Wraps environment variables, path expansion, filesystem operations, platform detection, and config file resolution with Option, Either, IO, and List.

Install

pnpm add functype-os functype

Modules

Env

Wraps process.env with Option and Either.

import { Env } from "functype-os"

Env("HOME") // Option<string>
Env.get("HOME") // Option<string>
Env.getRequired("DATABASE_URL") // Either<EnvError, string>
Env.getOrDefault("PORT", "3000") // string
Env.has("CI") // boolean
Env.entries() // List<readonly [string, string]>
Path

Pure path expansion — tilde, environment variables, and resolution.

import { expandTilde, expandVars, expandPath, Path } from "functype-os"

expandTilde("~/Documents") // "/home/user/Documents"
expandVars("$HOME/.config") // Either<PathError, string>
expandPath("~/$APP_DIR/config.toml") // Either<PathError, string> (absolute)

Path.join("a", "b") // "a/b"
Path.resolve("relative") // "/cwd/relative"
Path.dirname("/a/b/c.txt") // "/a/b"
Path.basename("/a/b/c.txt") // "c.txt"
Path.extname("file.ts") // ".ts"
Path.isAbsolute("/abs") // true
Fs

Async filesystem operations return a lazy IO: nothing touches the disk until you call .run(). Each *Sync method returns Either and runs immediately.

import { Fs } from "functype-os"

await Fs.exists("/path/to/file").run() // Either<never, boolean>
await Fs.readFile("/path/to/file").run() // Either<FsError, string>
await Fs.readFileOpt("/path/to/file").run() // Either<FsError, Option<string>> (None on ENOENT)
await Fs.readdir("/path/to/dir").run() // Either<FsError, List<string>>

// Being IO, they compose before anything runs:
const copyConfig = Fs.readFile(src)
  .flatMap((text) => Fs.writeFile(dest, text))
  .retry(2)
await copyConfig.run()

Forgetting .run() is a silent no-op: await Fs.mkdir(dir) awaits the IO value itself. The @typescript-eslint/await-thenable rule catches it when type-aware linting is on, as it is in ts-builds' functype preset.

Platform

OS and container/runtime detection with lazy-cached sync checks.

import { Platform } from "functype-os"

Platform.os() // "darwin" | "linux" | "win32" | string
Platform.arch() // "arm64" | "x64" | ...
Platform.homeDir() // "/home/user"
Platform.isWindows() // boolean
Platform.isMac() // boolean
Platform.isLinux() // boolean
Platform.userInfo() // Option<UserInfo>

// Container/runtime detection (lazy-cached)
Platform.isDocker() // boolean
Platform.isKubernetes() // boolean
Platform.isWSL() // boolean
Platform.isCI() // boolean
Platform.isContainer() // isDocker() || isKubernetes()
ConfigResolver

Find the first existing config file from a list of candidates with path expansion.

import { ConfigResolver } from "functype-os"

const config = await ConfigResolver.resolve({
  candidates: ["./app.toml", "~/.config/app/config.toml", "$APPDATA/app/config.toml"],
}).run()
// Either<never, Option<string>> — Right(Some("/home/user/.config/app/config.toml"))

const required = await ConfigResolver.resolveRequired({
  candidates: ["./app.toml", "~/.config/app/config.toml"],
}).run()
// Either<ConfigError, string> — Left(ConfigError) if none found

const all = await ConfigResolver.resolveAll({
  candidates: ["./a.toml", "./b.toml", "./c.toml"],
}).run()
// Either<never, List<string>> — all existing paths
Errors

Discriminated union error types for exhaustive matching.

import type { OsError } from "functype-os"
import { EnvError, PathError, FsError, ConfigError } from "functype-os"

const handleError = (error: OsError) => {
  switch (error._tag) {
    case "EnvError":
      return `Missing env var: ${error.variable}`
    case "PathError":
      return `Path issue: ${error.path} (${error.reason})`
    case "FsError":
      return `FS error: ${error.operation} on ${error.path}`
    case "ConfigError":
      return `No config found in: ${error.candidates.join(", ")}`
  }
}

Requirements

  • Node.js >= 18
  • functype >= 2.0.0 (peer dependency)

Development

pnpm install
pnpm dev              # build with watch
pnpm test             # run tests
pnpm validate         # format + lint + typecheck + test + build

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 functype-os

References

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

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

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

Frame 2085668439 (1)
Group 1261154229