@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:
| Package | Role |
|---|
effect | Provides the Effect type used by run and evaluate. All evaluation results are Effect values. |
typescript | Required 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.
{
"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 path | What it exports |
|---|
@lionlang/core/evaluation/evaluate | run and evaluate — the top-level evaluation functions |
@lionlang/core/modules | stdlib — the default environment with all built-in modules |
@lionlang/core/evaluation/environment | makeEnvironment — creates a scoped LionEnvironmentService |
Standard library modules
Each module is also importable individually if you want to compose a partial environment:
| Import path | Module |
|---|
@lionlang/core/modules/number | Arithmetic and comparison |
@lionlang/core/modules/string | String operations |
@lionlang/core/modules/boolean | Boolean logic |
@lionlang/core/modules/array | Array construction and transformation |
@lionlang/core/modules/object | Object access, method calls, and construction |
@lionlang/core/modules/func | Function binding, partial application, and callbacks |
@lionlang/core/modules/value | Type predicates and identity |
@lionlang/core/modules/console | Logging utilities |
Schemas and types
| Import path | What it exports |
|---|
@lionlang/core/schemas/lion-expression | LionExpressionSchema and LionExpressionType |
@lionlang/core/schemas/environment | Environment schema |
@lionlang/core/schemas/evaluation | Evaluation input/output schemas |
@lionlang/core/types/evaluation | EvaluateResult and related TypeScript types |
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.