PHP 8.2.30
Preview: README.md Size: 771 B
/home/byroehnu/easepay.easetack.com/node_modules/defaults/README.md

# defaults

> A simple one level options merge utility

## Install

```sh
npm install defaults
```

## Usage

```js
const defaults = require('defaults');

const handle = (options, fn) => {
	options = defaults(options, {
		timeout: 100
	});

	setTimeout(() => {
		fn(options);
	}, options.timeout);
}

handle({timeout: 1000}, () => {
	// We're here 1000 ms later
});

handle({timeout: 10000}, () => {
	// We're here 10s later
});
```

## Summary

this module exports a function that takes 2 arguments: `options` and `defaults`.  When called, it overrides all of `undefined` properties in `options` with the clones of properties defined in `defaults`

Sidecases: if called with a falsy `options` value, options will be initialized to a new object before being merged onto.

Directory Contents

Dirs: 1 × Files: 6

Name Size Perms Modified Actions
- drwxr-xr-x 2026-03-14 01:49:21
Edit Download
127 B lr--r--r-- 2026-03-14 01:49:21
Edit Download
277 B lrw-r--r-- 2026-02-28 00:26:42
Edit Download
1.09 KB lrw-r--r-- 2026-02-28 00:26:32
Edit Download
632 B lrw-r--r-- 2026-02-28 00:27:02
Edit Download
771 B lrw-r--r-- 2026-02-28 00:27:12
Edit Download
1.03 KB lrw-r--r-- 2026-02-28 00:26:52
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).