# itemsinlists

> Finds the best lists combination for required items

Latest version **0.1.0** (published 2015-07-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install itemsinlists
pnpm add itemsinlists
yarn add itemsinlists
bun add itemsinlists
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2015-07-24 |
| First published | 2015-07-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alejandro Moraga |
| Maintainers | moraga |
| Keywords | items, lists, array, combination, algorithm |

## Links

- npm: https://www.npmjs.com/package/itemsinlists
- Repository: https://github.com/Moraga/itemsinlists.js
- Issues: https://github.com/Moraga/itemsinlists.js/issues
- npm.io page: https://npm.io/package/itemsinlists

## Recent versions

- 0.1.0 (latest) — 2015-07-24

## README

Items in Lists
==============

Finds the best lists combination that have all required items or most of them.

This script was originally designed to improve loading external files.

* Page require N files
* Files are items
* Lists are packages of files
* Best lists combination reduces the traffic and requests
* Packages are good for client-server cache

## Example

```js
// required
var items = ['a', 'c', 'd', 'e'];

// available lists
var lists = {
	x: ['a', 'b', 'c'],
	y: ['a', 'b', 'e'],
	w: ['b', 'c'],
	i: ['d', 'e', 'f'],
	j: ['a', 'b', 'd', 'f', 'g'],
	k: ['b', 'm', 'n', 'o']
};

var solution = itemsinlists(items, lists);

console.log(solution);

{
	// lists combination
	conn: ['x', 'i'],
	// rest from last process
	find: ['d', 'e'],
	// lists have all items
	need: [],
	// efficiency
	rank: 0.4347826086956522
}

```

## License

MIT

## Author

Alejandro Moraga <moraga86@gmail.com>

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