Installation Guide
This guide covers installation and setup for all Molt packages.
Prerequisites
- Node.js: 16.x or later
- Package Manager: npm, pnpm, yarn, or Bun
Package Manager Options
npm
npm install @sylphx/molt-json
npm install @sylphx/molt-yaml
npm install @sylphx/molt-toml
npm install @sylphx/molt-csv
npm install @sylphx/molt-xmlpnpm
pnpm add @sylphx/molt-json
pnpm add @sylphx/molt-yaml
pnpm add @sylphx/molt-toml
pnpm add @sylphx/molt-csv
pnpm add @sylphx/molt-xmlyarn
yarn add @sylphx/molt-json
yarn add @sylphx/molt-yaml
yarn add @sylphx/molt-toml
yarn add @sylphx/molt-csv
yarn add @sylphx/molt-xmlBun
bun add @sylphx/molt-json
bun add @sylphx/molt-yaml
bun add @sylphx/molt-toml
bun add @sylphx/molt-csv
bun add @sylphx/molt-xmlModule Formats
All Molt packages are available in multiple module formats:
- CommonJS (.cjs) - For Node.js require
- ES Modules (.mjs) - For modern JavaScript
- TypeScript (.ts) - Type definitions included
Your package manager will automatically select the appropriate format.
TypeScript Support
All packages include full TypeScript support out of the box. Just import and use:
import { molt, stringify } from '@sylphx/molt-json'
const data = molt('{ name: "Alice" }')
const json = stringify(data)Per-Package Installation
molt-json
npm install @sylphx/molt-jsonThe fastest JSON transformer with dirty input support and type preservation.
Usage:
import { molt, stringify } from '@sylphx/molt-json'molt-yaml
npm install @sylphx/molt-yamlUltra-fast YAML parser and stringifier.
Usage:
import { parse, stringify } from '@sylphx/molt-yaml'molt-toml
npm install @sylphx/molt-tomlHigh-performance TOML parser and stringifier.
Usage:
import { parse, stringify } from '@sylphx/molt-toml'molt-csv
npm install @sylphx/molt-csvBlazingly fast CSV parser and stringifier with WASM acceleration.
Usage:
import { parse, stringify } from '@sylphx/molt-csv'molt-xml
npm install @sylphx/molt-xmlCompetitive XML parser with dirty XML cleaning support.
Usage:
import { parse, toObject } from '@sylphx/molt-xml'Monorepo Installation
For development or contribution, clone the repository:
git clone https://github.com/sylphx/molt.git
cd molt
bun installVerify Installation
Test your installation by importing and using a package:
// test.js
import { molt } from '@sylphx/molt-json'
const data = molt('{ name: "Alice", age: 30 }')
console.log(data)
// Output: { name: "Alice", age: 30 }Run with Node.js:
node test.jsTroubleshooting
Module not found errors
Ensure you're using the correct import path:
// ✅ Correct
import { molt } from '@sylphx/molt-json'
// ❌ Incorrect
import { molt } from '@sylphx/molt'TypeScript errors
Ensure your tsconfig.json targets ES2020 or later:
{
"compilerOptions": {
"target": "ES2020",
"moduleResolution": "node"
}
}Performance not as expected
Some performance features require optimization:
- Use production builds (not development)
- For molt-csv, ensure WASM modules are properly loaded
- Run benchmarks with the runtime (Bun) that matches your production environment
Version Management
Check installed versions:
npm list @sylphx/molt-json
npm list @sylphx/molt-yaml
# etc.Update to latest:
npm update @sylphx/molt-json
npm update @sylphx/molt-yaml
# etc.Platform Support
Molt packages are tested and supported on:
- ✅ Node.js 16.x+
- ✅ Bun 1.0+
- ✅ Deno (via npm imports)
- ✅ Browser (with bundler like Vite, webpack, or esbuild)
Next Steps
- Quick Start Examples - See common usage patterns
- Performance Tips - Optimize your usage
- Package Documentation - Deep dive into each package
Ready to get started? Check out the Quick Start Guide!