typeorm-transformers
v0.1.2
Published
[TypeORM](https://github.com/typeorm/typeorm) transformers
Downloads
13
Readme
@anchan828/typeorm-transformers
Description
Transformer collection for TypeORM
Installation
$ npm i --save @anchan828/typeorm-transformers
Quick Start
@Entity()
class BooleanTransformerTest extends BaseEntity {
@PrimaryGeneratedColumn()
public id!: number;
@Column({
type: 'tinyint',
width: 1,
nullable: true,
transformer: new BooleanTransformer(),
})
public bool!: boolean;
}
class TestJson {
name!: string;
}
@Entity()
class JsonTransformerTest extends BaseEntity {
@PrimaryGeneratedColumn()
public id!: number;
@Column({
type: 'varchar',
width: 255,
nullable: true,
transformer: new JsonTransformer<TestJson>({ name: 'test' }),
})
public data!: TestJson;
}
License
MIT.