mapia
v1.4.1
Published
Type-first superfast data-mapper (JSON transformation library) for TypeScript. Fast, safe, and easy to use. Supports classes, interfaces, types
Maintainers
Readme
Mapia
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 mapiaimport { 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
You can run the benchmark yourself with:
pnpm run:benchContributing
Contributions are welcome! See docs/contributing.md for how to get involved.
License
Mapia is released under the MIT License.
