Skip to content

alexcupertme/mapia

Repository files navigation

Mapia

License TypeScript Test & Coverage codecov

Mapia is a fast, type-safe object mapper for TypeScript that keeps mappings explicit without imposing runtime dependencies. The mapper infers every field from the source and destination shapes, so you are protected from typos and silent runtime failures.

Note

December 2025 update: Mapia is now faster up to 2000x than Class Transformer and AutoMapper-TS

Quick start

pnpm add mapia
import { compileMapper, rename, transform, ignore } from 'mapia';

const userMapper = compileMapper<UserResponse, UserEntity>({
  id: transform((value) => Number(value)),
  name: rename('fullName'),
  updatedAt: ignore(),
});

const user = userMapper.mapOne(apiResponse);

Documentation

The full documentation is now can be found here:

https://alexcupertme.github.io/mapia/

Benchmark

benchmark

You can run the benchmark yourself with:

pnpm run:bench

Contributing

Contributions are welcome! See docs/contributing.md for how to get involved.

License

Mapia is released under the MIT License.

Packages

No packages published

Contributors 2

  •  
  •