# const

> The constant function from functional programming: it takes a value and returns a function that will return that value:

Latest version **1.0.0** (published 2013-10-24) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2013-10-24 |
| First published | 2013-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Hugh FD Jackson |
| Maintainers | hughfdjackson |
| Keywords | constant, const, lift, k, K, combinator |

## Links

- npm: https://www.npmjs.com/package/const
- Repository: https://github.com/hughfdjackson/const
- Issues: https://github.com/hughfdjackson/const/issues
- npm.io page: https://npm.io/package/const

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2013-10-24
- 0.0.1 — 2013-10-23

## README

# const

The constant function from functional programming: it takes a value and returns a function that will return that value:

```javascript
var constant = require('const')
var alwaysA = constant('a');

alwaysA() //= 'a'
```

Useful to lifting a value into the world of functions, e.g. when using promises:
```javascript
getUserDetails()
	.then(getMessageFromUser, constant('User not found'))
```

Other names it's gone by in the past:

* K combinator
* lift
* always

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