1.5.7 • Published 3 months ago

typescript-factory-foundry v1.5.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Typescript Factory Foundry

Install

Install using npm or yarn:

npm i --save-dev typescript-factory-foundry

Getting Started

Create a simple typescript file (e.g. myTypes.ts) with interfaces/types:

export interface SimpleInterface {
  prop1: string;
  prop2: number;
  prop3: {
    innerProp: string;
  };
}

run the command:

npx typescript-factory-foundry ./src/myTypes.ts ./src/generated

and use the generated builders:

import {aSimpleInterfaceBuilder} from './generated';

const builder = aSimpleInterfaceBuilder().withProp1('my prop').withProp3({innerProp: 'an inner prop'});

// item contains the data we defined in the builder
const item = builder.get();

Additional Options

CodeCommand LineDescription
useNullInitializer-n, --use-default-nullsuse null as default value in builder properties initializer

Additional Info

Here you can find a more in-depth explanation of how the library can be used and what kind of problems it can solve.

1.5.7

3 months ago

1.5.5

2 years ago

1.5.4

2 years ago

1.5.6

2 years ago

1.2.4

2 years ago

1.1.3

2 years ago

1.1.0

2 years ago

1.0.6

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.0

2 years ago