Skip to main content
@lionlang/core is published to npm as an ESM-only package. This page covers how to install it with your preferred package manager, which peer dependencies you need, what the package exports, and the TypeScript configuration it requires.

Install the package

npm install @lionlang/core effect
If you are using Bun, run bun add @lionlang/core effect from your project root. Bun resolves and installs all transitive dependencies automatically without a separate bun install step after adding packages.

Peer dependencies

@lionlang/core has two peer dependencies that you must install alongside it:
PackageRole
effectProvides the Effect type used by run and evaluate. All evaluation results are Effect values.
typescriptRequired at build time. The package ships only TypeScript source types; there is no separate @types package.

TypeScript configuration

@lionlang/core is built with ESNext output and NodeNext module resolution. Your tsconfig.json must match these settings or the package’s subpath exports will not resolve correctly.
tsconfig.json
{
  "compilerOptions": {
    "target": "ESNext",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "strict": true
  }
}
Strict mode is required. The package uses exactOptionalPropertyTypes, noUncheckedIndexedAccess, and related strict flags internally. Disabling strict mode in your project may cause type errors when importing from @lionlang/core.

Package exports

@lionlang/core uses the Node.js exports field to expose fine-grained subpath entry points. Import directly from the path you need rather than the package root.

Core entry points

Import pathWhat it exports
@lionlang/core/evaluation/evaluaterun and evaluate — the top-level evaluation functions
@lionlang/core/modulesstdlib — the default environment with all built-in modules
@lionlang/core/evaluation/environmentmakeEnvironment — creates a scoped LionEnvironmentService

Standard library modules

Each module is also importable individually if you want to compose a partial environment:
Import pathModule
@lionlang/core/modules/numberArithmetic and comparison
@lionlang/core/modules/stringString operations
@lionlang/core/modules/booleanBoolean logic
@lionlang/core/modules/arrayArray construction and transformation
@lionlang/core/modules/objectObject access, method calls, and construction
@lionlang/core/modules/funcFunction binding, partial application, and callbacks
@lionlang/core/modules/valueType predicates and identity
@lionlang/core/modules/consoleLogging utilities

Schemas and types

Import pathWhat it exports
@lionlang/core/schemas/lion-expressionLionExpressionSchema and LionExpressionType
@lionlang/core/schemas/environmentEnvironment schema
@lionlang/core/schemas/evaluationEvaluation input/output schemas
@lionlang/core/types/evaluationEvaluateResult and related TypeScript types

Special forms (individual imports)

Each special form is available at its own path if you need to compose a custom evaluator:
@lionlang/core/evaluation/special-forms/define
@lionlang/core/evaluation/special-forms/lambda
@lionlang/core/evaluation/special-forms/cond
@lionlang/core/evaluation/special-forms/match
@lionlang/core/evaluation/special-forms/begin
@lionlang/core/evaluation/special-forms/quote
@lionlang/core/evaluation/special-forms/eval

Verify the installation

After installing, run this snippet to confirm everything is wired up correctly:
import { Effect } from "effect";
import { run } from "@lionlang/core/evaluation/evaluate";
import { stdlib } from "@lionlang/core/modules";

const result = await Effect.runPromise(
  run(["number/add", 1, 2], stdlib)
);

console.log(result); // => 3
If you see 3 in the console, @lionlang/core is installed and working. See Quickstart for the next steps.