JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 343
  • Score
    100M100P100Q87131F
  • License MIT

Linux-like OS engine for JavaScript -- kernel, shell, VFS, and 60+ commands

Package Exports

  • @lifo-sh/core

Readme

@lifo-sh/core

Core engine for Lifo -- a Linux-like OS that runs natively in JavaScript. Provides the kernel, virtual filesystem, shell, and 60+ commands.

Works in both browser and Node.js environments.

Install

npm install @lifo-sh/core

Quick Start

Headless / Programmatic

import { Sandbox } from '@lifo-sh/core';

const sandbox = await Sandbox.create();

const result = await sandbox.commands.run('echo hello world');
console.log(result.stdout); // "hello world\n"

await sandbox.fs.writeFile('/tmp/greeting.txt', 'Hi there');
const content = await sandbox.fs.readFile('/tmp/greeting.txt');
console.log(content); // "Hi there"

Browser with Terminal UI

import { Sandbox } from '@lifo-sh/core';

// Requires @lifo-sh/ui as an optional peer dependency
const sandbox = await Sandbox.create({
  terminal: '#terminal-container',
  persist: true,
});

What's Included

  • Kernel -- virtual filesystem (VFS), virtual /proc and /dev providers, IndexedDB persistence
  • Shell -- bash-like interpreter with pipes, redirects, globs, variables, job control, tab completion, history
  • 60+ commands -- ls, grep, awk, sed, curl, node, tar, find, and more
  • Sandbox API -- high-level commands.run() and fs.* for programmatic use
  • Node.js compat layer -- run JS files with node script.js using shimmed fs, path, http, etc.

Packages

Package Description
@lifo-sh/core Kernel, shell, commands, sandbox API
@lifo-sh/ui Terminal UI (xterm.js wrapper)
lifo-sh CLI -- run Lifo in your terminal

License

MIT