# createVariable

FUNCTION in `@skmtc/lang-typescript 0.19.1`

Creates a variable identifier - a value entity that declares with
`const` and imports as a plain named import.

## Signature

```ts
import { createVariable } from '@skmtc/lang-typescript'

createVariable(name: string, args?: CreateVariableArgs): TsIdentifier
```

## Parameters

- `name` (string, required)
- `args` (CreateVariableArgs)
  - `typeName` (string): Optional type annotation for typed variables.
  - `exported` (boolean): Whether the identifier is exported. Defaults to `true`.

## Examples

Untyped variable:

```ts
const count = createVariable('count');
console.log(count.name); // 'count'
console.log(count.type); // 'variable'
```

Typed variable:

```ts
const userId = createVariable('userId', { typeName: 'string' });
// TsDefinition renders: export const userId: string = …;
```

## Returns

`TsIdentifier`
