[Canonical page](<https://docs.dhtmlx.com/planning-engine/js/api/init/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# init

The package's default export. It loads nothing and resolves immediately. A [`Project`](<https://docs.dhtmlx.com/planning-engine/js/api/project.md>) works right after import, with or without `init()`.

## Signature

```ts
export default function init(input?: unknown): Promise<unknown>
```

Async: the only export of the package that returns a `Promise`.

## Parameters

| Name | Type | Description |
|---|---|---|
| `input` | `unknown` | Optional. Ignored. |

## Returns

A `Promise` that resolves to `undefined`.

## Errors

None. The promise always resolves.

## Variants

### CommonJS

In the CJS build, `init` is the `default` property of the module object. The named exports stay direct.

```js
const plen = require("plen-js");

plen.default().then(() => {
  const project = new plen.Project();
});
```

## Example

```js
import init, { Project } from "plen-js";

async function main() {
  await init(); // optional: resolves immediately
  const project = new Project();
  project.solve({
    tasks: [{ id: 1, start_date: "2026-08-10 08:00", duration: 2 }],
  });
}

main();
```

## Related

- [`Project`](<https://docs.dhtmlx.com/planning-engine/js/api/project.md>) - works without calling `init`
- [Switch from the WASM package](<https://docs.dhtmlx.com/planning-engine/js/how-to/switch-from-the-wasm-package.md>) - what `init()` and `dispose()` do in this package
- [Quick start](<https://docs.dhtmlx.com/planning-engine/js/quick-start.md>) - installing and importing the package
