Packages

Multi-surface application runtime for Elixir. One TEA module renders to terminal, browser (LiveView), SSH, and MCP (agents). 30+ widgets, flexbox + CSS grid, AI agent runtime, distributed swarm with CRDTs, time-travel debugging, session recording, sandboxed REPL, and agentic commerce.

Current section

Files

Jump to
raxol lib raxol core platform.ex
Raw

lib/raxol/core/platform.ex

defmodule Raxol.Core.Platform do
@moduledoc """
Platform detection utilities for cross-platform compatibility.
"""
@doc """
Checks if the current platform is macOS.
"""
def macos? do
case :os.type() do
{:unix, :darwin} -> true
_ -> false
end
end
@doc """
Checks if the current platform is Linux.
"""
def linux? do
case :os.type() do
{:unix, :linux} -> true
_ -> false
end
end
@doc """
Checks if the current platform is Windows.
"""
def windows? do
case :os.type() do
{:win32, _} -> true
_ -> false
end
end
@doc """
Returns the OS type as an atom.
"""
def os_type do
case :os.type() do
{:unix, :darwin} -> :macos
{:unix, :linux} -> :linux
{:win32, _} -> :windows
other -> other
end
end
end