Wetland is a modern object-relational mapper (ORM) for Node.js, inspired by the JPA specification (Hibernate/Doctrine). Version 5.1.2 is the latest stable release. It provides a full-featured ORM with unit of work, migrations, transactions, query builder, entity manager, repositories, and deep joins. Built on top of Knex, it supports MySQL, SQLite, and PostgreSQL. Wetland's key differentiators include JPA-like structure, optimized state management, and recipe-based hydration. Typings are included for TypeScript users. The package is actively maintained.
npm install wetlandNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows instantiation of Wetland, creating tables via migrator, and querying with joins.
Use a different database like MySQL or PostgreSQL for foreign key support.
Use import { Wetland } from 'wetland' instead of const Wetland = require('wetland'). For CommonJS projects, use dynamic import or update to ESM.Install wetland-cli globally: npm i -g wetland-cli
Add static setMapping(mapping) { ... } to entity classes.Pass entities array in Wetland configuration.
Run: npm install wetland
Use import { Wetland } from 'wetland' instead of import Wetland from 'wetland'.Add static setMapping(mapping) { ... } to entity class.Ensure store configuration has correct client and connection parameters.
Use Wetland v4 or ensure your project is ESM. Alternatively, use dynamic import.