# fn-getter

> Simple, lazyily evaluated values.

Latest version **1.0.0** (published 2015-12-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install fn-getter
pnpm add fn-getter
yarn add fn-getter
bun add fn-getter
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-12-25 |
| First published | 2015-12-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Jonathan Ong |
| Maintainers | jongleberry |
| Keywords | lazy, getter, function, value, evaluation |

## Links

- npm: https://www.npmjs.com/package/fn-getter
- Repository: https://github.com/jonathanong/fn-getter
- Homepage: https://github.com/jonathanong/fn-getter#readme
- Issues: https://github.com/jonathanong/fn-getter/issues
- npm.io page: https://npm.io/package/fn-getter

## Recent versions

- 1.0.0 (latest) — 2015-12-25
- 0.0.0 — 2015-12-25

## README

# fn-getter

[![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![Dependency Status][david-image]][david-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

Simple, lazyily evaluated values.
If a value takes too long to calculate,
but you don't need it right away (ex. on startup),
then evaluate lazily.

```js
const createGetter = require('fn-getter')

const createS3Client = createGetter(() => {
  const AWS = require('aws-sdk')
  return new AWS.S3()
})
```

Maybe you want to evaluate it after the first time:

```js
setImmediate(createS3Client)
```

Then, when you need to use it:

```js
app.use((req, res, next) => {
  createS3Client().putObject(...)
})
```

[npm-image]: https://img.shields.io/npm/v/fn-getter.svg?style=flat-square
[npm-url]: https://npmjs.org/package/fn-getter
[travis-image]: https://img.shields.io/travis/jonathanong/fn-getter.svg?style=flat-square
[travis-url]: https://travis-ci.org/jonathanong/fn-getter
[codecov-image]: https://img.shields.io/codecov/c/github/jonathanong/fn-getter/master.svg?style=flat-square
[codecov-url]: https://codecov.io/github/jonathanong/fn-getter
[david-image]: http://img.shields.io/david/jonathanong/fn-getter.svg?style=flat-square
[david-url]: https://david-dm.org/jonathanong/fn-getter
[license-image]: http://img.shields.io/npm/l/fn-getter.svg?style=flat-square
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/fn-getter.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/fn-getter

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