Natis is a MySQL utility library (version 3.0.1) that provides a thin wrapper around the mysql2 package for Node.js. It simplifies common MySQL operations such as querying, connection pooling, and transaction management with a promise-based API. Unlike full-fledged ORMs like Sequelize or TypeORM, Natis focuses on lightweight, minimal abstraction, giving developers direct SQL control while handling connection lifecycle and error retries. It is released on an as-needed cadence, with v3 introducing breaking changes to the API (async/await required, no callback support). Requires mysql2 as a peer dependency and supports TypeScript definitions.
npm install natisNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Establishes a MySQL connection using createConnection, creates a table, inserts a row, and queries all rows.
Switch to ESM imports (import { ... } from 'natis') or continue using v2.x for CommonJS support.Use async/await or .then() instead of callback functions.
Replace 'pool' with 'createPool' from '@natis/core' or upgrade to v3.
Always check connection state and re-create on error. Use connection pools for reliability.
npm install natis mysql2
Use dynamic import: const natis = await import('natis') or add 'type': 'module' to package.json.Use query(conn, 'SQL') instead of conn.query().