Locutus is a collection of TypeScript implementations of standard library functions from multiple programming languages.
The project solves the problem of needing standard library functionality from other languages in TypeScript environments. Rather than recreating entire language runtimes, Locutus reimplements the behavior and semantics of standard library functions while keeping APIs native to JavaScript. This means accepting JavaScript types as input and returning JavaScript types as output, without forcing developers to work with foreign data structures like Go slices, Python tuples, or Ruby symbols. The implementations are individually importable and tree-shakeable, allowing developers to pull in only what they need.
Locutus suits developers who occasionally need specific standard library behavior from PHP, Go, Python, Ruby, C, and other languages but want to stay within a TypeScript codebase. For browser-based applications concerned with bundle size, the tool supports deep imports of individual functions rather than category-level imports, which prevents bundlers from pulling in unrelated exports. The project explicitly avoids recreating language-specific object models, keeping the API surface pragmatic and JavaScript-friendly.
The project maintains a straightforward versioning approach where patch-level changes are the default even for function-level parity fixes. Development includes cross-language verification testing to ensure ported functions behave correctly relative to their source implementations. The codebase uses Biome for linting and formatting, with a test suite covering both individual function behavior and parity across languages. Published artifacts target Node 22 and above, with ES2022 output for distribution, while copy-paste snippets on the documentation site target widely available baseline features that may require transpilation for older browser environments.