npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@titanpl/core

v26.17.1

Published

The official Core Standard Library for Titan Planet - provides fs, path, crypto, os, net, proc, time, and url modules

Readme

@titanpl/core

The official Core Standard Library for Titan Planet - a high-performance JavaScript runtime extension. This library bridges high-performance Rust native implementations with an easy-to-use JavaScript API.

Overview

@titanpl/core provides essential standard library modules for Titan applications, covering file system operations, cryptography, process management, networking, and more. All modules are implemented as native Rust extensions for maximum performance.

Installation

npm install @titanpl/core

Usage

The extension automatically attaches to the Titan runtime.

Modern ESM Import (Highly Recommended)

Best for IDE support, autocompletion, and type checking.

import { fs, crypto, ls } from "@titanpl/core";

const content = fs.readFile("config.json");

API Reference

fs (File System)

Synchronous file system operations.

  • fs.readFile(path: string): string - Read file content as UTF-8 string.
  • fs.writeFile(path: string, content: string): void - Write string content to file.
  • fs.exists(path: string): boolean - Check if a path exists.
  • fs.mkdir(path: string): void - Create a directory (recursive).
  • fs.remove(path: string): void - Remove file or directory.
  • fs.readdir(path: string): string[] - List directory contents.
  • fs.stat(path: string): object - Get file statistics { isFile: boolean, isDir: boolean, size: number, modified: number }.

path (Path Manipulation)

Utilities for handling file paths.

  • path.join(...parts: string[]): string - Join path segments using platform-specific separators.
  • path.resolve(...parts: string[]): string - Resolve path to an absolute path.
  • path.dirname(path: string): string - Get the directory name of a path.
  • path.basename(path: string): string - Get the base name (filename) of a path.
  • path.extname(path: string): string - Get the extension of a path (including the dot).

crypto (Cryptography)

Secure cryptographic utilities.

  • crypto.hash(algo: string, data: string): string - Hash data (e.g., sha256, sha512).
  • crypto.randomBytes(size: number): string - Generate random bytes as a hex string.
  • crypto.uuid(): string - Generate a UUID v4.
  • crypto.encrypt(algorithm: string, key: string, plaintext: string): string - Encrypt text using native Rust implementations.
  • crypto.decrypt(algorithm: string, key: string, ciphertext: string): string - Decrypt text.
  • crypto.hashKeyed(algo: string, key: string, message: string): string - Keyed-hash (HMAC) support.
  • crypto.compare(hash: string, target: string): boolean - Securely compare two strings in constant time.

buffer (Buffer Utilities)

Utilities for binary and data encoding.

  • buffer.fromBase64(str: string): Uint8Array - Decode Base64 string to bytes.
  • buffer.toBase64(bytes: Uint8Array|string): string - Encode bytes or string to Base64.

os (Operating System)

Retrieve system-level information.

  • os.platform(): string - OS platform (e.g., linux, windows, darwin).
  • os.cpus(): number - Number of logical CPU cores.
  • os.totalMemory(): number - Total system memory in bytes.
  • os.freeMemory(): number - Free system memory in bytes.
  • os.tmpdir(): string - Path to the system temporary directory.

net (Network)

Basic network utilities.

  • net.resolveDNS(hostname: string): string[] - Resolve a hostname to IP addresses.
  • net.ip(): string - Get the local system IP address.

proc (Process Management)

Manage and query system processes.

  • proc.pid(): number - Get the Process ID of the current Titan runtime.
  • proc.info(): object - Get basic info about the current process.
  • proc.run(command: string, args?: string[], cwd?: string): object - Spawn a background process.
  • proc.kill(pid: number): boolean - Terminate a process by PID.
  • proc.list(): object[] - List all running system processes with CPU and memory usage.

time (Time Utilities)

  • time.sleep(ms: number): void - Synchronously block execution for ms milliseconds.
  • time.now(): number - Returns Date.now().

ls (Persistent Local Storage)

High-performance key-value storage persisted to disk.

  • ls.get(key: string): string|null - Retrieve a string value.
  • ls.set(key: string, value: string): void - Persist a string value.
  • ls.remove(key: string): void - Delete a key.
  • ls.clear(): void - Clear all stored data.
  • ls.keys(): string[] - List all stored keys.
  • ls.setObject(key: string, value: any): void - Store a complex JS object using native V8 serialization.
  • ls.getObject(key: string): any - Retrieve and restore a complex JS object.
  • ls.serialize(value: any): Uint8Array - Native V8 serialization (supports Map, Set, Date, Uint8Array).
  • ls.deserialize(bytes: Uint8Array): any - Native V8 deserialization.

session (Session Management)

  • session.get(sid: string, key: string): string|null - Get session data.
  • session.set(sid: string, key: string, value: string): void - Set session data.
  • session.delete(sid: string, key: string): void - Delete session data.
  • session.clear(sid: string): void - Clear an entire session.

cookies (HTTP Cookies)

  • cookies.get(req: object, name: string): string|null - Extract cookie value from request.
  • cookies.set(res: object, name: string, value: string, options?: object): void - Attach Set-Cookie to response.

url (URL Parsing)

  • url.parse(str: string): URL - Parse a URL string into a native URL object.
  • new url.SearchParams(init?: string) - Construct query parameters.

response (HTTP Response Builder)

Helper for constructing standardized Titan responses.

  • response.text(content: string, options?: object): object - Create a plain text response.
  • response.json(data: any, options?: object): object - Create a JSON response.
  • response.html(content: string, options?: object): object - Create an HTML response.
  • response.redirect(url: string, status?: number): object - Create a redirect response.

Native Bindings

This extension includes native Rust bindings for high-performance operations. The native binary is automatically loaded by the Titan Runtime during initialization.

License

ISC