init#

The package's default export. It loads nothing and resolves immediately. A Project works right after import, with or without init().

Signature#

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.

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

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

Example#

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();