
Company News
Meet the Socket Team at RSAC and BSidesSF 2026
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.
@adviser/cement
Advanced tools
An agnostic platform abstraction layer for TypeScript/JavaScript and Go that provides consistent APIs across Node.js, Deno, Cloudflare Workers, and other runtimes.
Cement provides a unified interface for common system operations, logging, and utilities across different JavaScript/TypeScript runtimes and Go. Write your code once and run it anywhere - whether that's Node.js, Deno, browsers, or Cloudflare Workers.
Cross-platform system operations through a unified interface:
interface SysAbstraction {
Time(): Time;
Stdout(): WritableStream<Uint8Array>;
Stderr(): WritableStream<Uint8Array>;
NextId(): string;
Random0ToValue(value: number): number;
System(): SystemService;
FileSystem(): FileService;
}
Inspired by Go's zerolog, providing efficient structured logging:
logger
.Str("user", "john")
.Uint64("id", 123)
.Info()
.Log("User logged in");
npm install @adviser/cement
pnpm add @adviser/cement
import { ... } from "jsr:@adviser/cement";
go get github.com/mabels/cement
import { BuildBasicSystemService } from "@adviser/cement/node";
const sys = BuildBasicSystemService();
const logger = sys.Logger();
logger
.Str("module", "app")
.Info()
.Log("Application started");
// Use file system operations
const fs = sys.FileSystem();
await fs.writeFile("output.txt", "Hello World");
// Node.js
import { BuildBasicSystemService } from "@adviser/cement/node";
// Deno
import { BuildBasicSystemService } from "@adviser/cement/deno";
// Cloudflare Workers
import { BuildBasicSystemService } from "@adviser/cement/cf";
// Browser/Web
import { BuildBasicSystemService } from "@adviser/cement/web";
import { Result } from "@adviser/cement";
function divide(a: number, b: number): Result<number> {
if (b === 0) {
return Result.Err(new Error("Division by zero"));
}
return Result.Ok(a / b);
}
const result = divide(10, 2);
if (result.isOk()) {
console.log("Result:", result.unwrap());
} else {
console.error("Error:", result.unwrapErr());
}
For comprehensive documentation, API references, and advanced usage examples, visit:
https://mabels.github.io/cement
# Install dependencies
pnpm install
# Run tests
pnpm test
# Run tests for specific platform
pnpm test:js # Node.js/JavaScript tests
pnpm test:deno # Deno tests
# Build
pnpm build
# Lint
pnpm lint
# Format code
pnpm format
Contributions are welcome! Please feel free to submit a Pull Request.
Apache License 2.0 - See LICENSE for details.
FAQs
better try/catch/finally handling
The npm package @adviser/cement receives a total of 5,264 weekly downloads. As such, @adviser/cement popularity was classified as popular.
We found that @adviser/cement demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.

Research
/Security News
Malicious Packagist packages disguised as Laravel utilities install an encrypted PHP RAT via Composer dependencies, enabling remote access and C2 callbacks.

Research
/Security News
OpenVSX releases of Aqua Trivy 1.8.12 and 1.8.13 contained injected natural-language prompts that abuse local AI coding agents for system inspection and potential data exfiltration.