# Init API reference

> Exports of @npm-factory/init.

Source: https://npm-factory.n.yatsyk.com/docs/init/jsdoc

## Functions

### runInit

```ts
runInit(config: InitConfig): Promise<ResolvedConfig>
```

### resolveConfig

```ts
resolveConfig(config: InitConfig): ResolvedConfig
```

### buildPackageName

```ts
buildPackageName(scope: string, projectId: string, mod: { packageNameSuffix: string; }): string
```

### packageNameToFolder

```ts
packageNameToFolder(packageName: string): string
```

## Types

### InitConfig

```ts
type InitConfig = {
  projectId: string;
  scope: string;
  modules: ModuleInput[];
  playgroundMode: PlaygroundMode;
  cwd: string;
}
```

### ModuleInput

```ts
type ModuleInput = {
  moduleId: string;
  packageNameSuffix: string;
  title: string;
  description: string;
  kind: ModuleKind;
  platforms: ModulePlatform[];
  stability: ModuleStability;
}
```

### ModuleKind

```ts
type ModuleKind = "core" | "integration" | "plugin" | "sdk" | "cli"
```

### ModulePlatform

```ts
type ModulePlatform = | "node"
  | "browser"
  | "react"
  | "react-native"
  | "vue"
  | "svelte"
  | "solid"
  | "universal"
```

### ModuleStability

```ts
type ModuleStability = "experimental" | "beta" | "stable" | "deprecated"
```

### PlaygroundMode

```ts
type PlaygroundMode = "none" | "single" | "per-module"
```

### ResolvedConfig

```ts
type ResolvedConfig = InitConfig & {
  siteDir: string;
  configDir: string;
  modulesResolved: ResolvedModule[];
}
```

### ResolvedModule

```ts
type ResolvedModule = ModuleInput & {
  packageName: string;
  packageDir: string;
  docsDir: string;
  docsDirRelativeToSite: string;
}
```

## Constants

### defaults

```ts
const defaults: { readonly version: "0.1.0"; readonly license: "MIT"; readonly nodeEngines: ">=20"; readonly orphanMode: "warn"; }
```
