# taxman

> taxman caches values for you

Latest version **0.1.1** (published 2011-08-29) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2011-08-29 |
| First published | 2011-05-05 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.4.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Marcello Bastéa-Forte |
| Maintainers | marcello |
| Keywords | taxman, cache, future |

## Links

- npm: https://www.npmjs.com/package/taxman
- Repository: https://github.com/marcello3d/node-taxman
- npm.io page: https://npm.io/package/taxman

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2011-08-29
- 0.1.0 — 2011-05-05

## README

node-taxman
===========
Taxman caches values for you.

Introduction
------------
This module was inspired by the need for an easy way to asynchronously compute a value once, but use it in multiple
places.

Examples
--------
    var taxman = require('taxman')
    
    // Create a taxman to compute the value
    var computation = taxman(function(callback) {
        console.log("Doing lots of hard work...")
        var x = 3 * 5
        callback(null, x)
    })

    // Get the computation value (this first call will start the computation, synchronously, in this case)
    computation(function(error, value) {
        if (error) {
            console.error("1a: computation failed")
        } else {
            console.log("1a: success! result = ", value)
        }
    })

    // Get the computation value again (retrieves cached value)
    computation(function(error, value) {
        if (error) {
            console.error("1b: computation failed")
        } else {
            console.log("1b: success! result = ", value)
        }
    })

    // Reset the cache
    computation.reset()

    // Get the computation value (this will re-compute the value)
    computation(function(error, value) {
        if (error) {
            console.error("1c: computation failed")
        } else {
            console.log("1c: success! result = ", value)
        }
    })

Outputs:

    Doing lots of hard work...
    1a: success! result =  15
    1b: success! result =  15
    Doing lots of hard work...
    1c: success! result =  15


See [test.js][1] for more examples.

License
-------
Taxman is open source software under the [zlib license][2].

[1]: https://github.com/marcello3d/node-taxman/blob/master/test.js
[2]: https://github.com/marcello3d/node-taxman/blob/master/LICENSE

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