# plan-loader

> A loader based on plans.

Latest version **8.10.3** (published 2025-01-01) · SEE LICENSE IN LICENSE.md license · 0 weekly downloads

## Install

```sh
npm install plan-loader
pnpm add plan-loader
yarn add plan-loader
bun add plan-loader
```

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 8.10.3 |
| Published | 2025-01-01 |
| First published | 2019-03-02 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE.md |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >= 14.0.0 |
| Dependencies | 1 |
| Unpacked size | 29.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 0 |
| Author | cloewen8 |
| Maintainers | cj* |
| Keywords | loader, plan, starter |

## Links

- npm: https://www.npmjs.com/package/plan-loader
- Repository: https://github.com/cloewen8/Plan-Loader
- Homepage: https://github.com/cloewen8/Plan-Loader#readme
- Issues: https://github.com/cloewen8/Plan-Loader/issues
- npm.io page: https://npm.io/package/plan-loader

## Dependencies (1)

- [enum](https://npm.io/package/enum.md) ~2.5.0

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 8.10.3 (latest) — 2025-01-01
- 8.10.2 — 2023-02-01
- 8.10.1 — 2023-01-11
- 8.10.0 — 2022-08-04
- 8.9.4 — 2021-10-28
- 8.8.4 — 2021-08-12
- 8.8.3 — 2021-05-07
- 8.8.1 — 2020-07-21
- 8.8.0 — 2020-07-21
- 8.7.0 — 2019-07-13
- 8.6.0 — 2019-06-06
- 8.5.0 — 2019-04-04
- 8.4.0 — 2019-04-03
- 8.3.3 — 2019-03-02

## README

**Help Wanted:** Do you use my packages? Let me know at https://cjloewen.ca/contact

# Plan-Loader
A loader based on plans that chooses what, when, and in what order
to load. Allowing for **more flexibility** with a **standard design**.

## Use Cases
It can be difficult at times to know what to use a loader for. Here is a list of a few possible uses!

- **Web server** - Individual sections of the website could be bound to separately using sub-plans.
- **Task automation** - Tasks could be split into plans and executed in a customized order.
- **Chat bot** - You can split commands into their own files and have them execute when an event is emitted.

## Getting Started
The plan loader uses objects known as plans. A plan is a set of instructions on how to run the desired code.

In order for a plan to run code, all it needs is an `execute` method, which takes 0 or more arguments.
```js
import { execute } from 'plan-loader';

execute({
	execute: () => {
		console.log('Hello world!');
	}
});
```
```text
Hello world!
```

A plan can also point to other plans to cover an entire project's loading needs!
```js
import { execute } from 'plan-loader';

execute({
	execute: () => {
		console.log('Hello world!');
	},
	plans: [
		{
			execute: () => {
				console.log('Hello galaxy!');
			}
		},
		{
			execute: () => {
				console.log('Hello universe!');
			}
		}
	]
});
```
```text
Hello world!
Hello galaxy!
Hello universe!
```

**For more information, run `npm run docs`.**

---
_Source: https://npm.io/package/plan-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
