File: README.md

package info (click to toggle)
node-tap 12.0.1%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 3,996 kB
  • sloc: javascript: 13,674; sh: 75; makefile: 73
file content (28 lines) | stat: -rw-r--r-- 566 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# yapool

Yet Another object pool in JavaScript

Because [yallist](http://npm.im/yallist) is sometimes too featureful,
this is a very dead-simple linked-list pool thingie in JavaScript that
lets you add and remove objects in a set.

Not suitable for very long lists, because all searches are `O(n)`, but
for small `n`, it has very low complexity.

## API

`p = new Pool()`

Constructor takes no arguments

`p.add(someObject)`

put an object in the pool

`p.length`

return the number of things in the pool.

`p.remove(someObject)`

remove that object from the pool.