# feint

> Make a given function do nothing at its first call

Latest version **1.0.3** (published 2019-05-26) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-05-26 |
| First published | 2017-04-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Watanabe Shinnosuke |
| Maintainers | shinnn |
| Keywords | feint, function, call, noop, time |

## Links

- npm: https://www.npmjs.com/package/feint
- Repository: https://github.com/shinnn/feint
- Homepage: https://github.com/shinnn/feint#readme
- Issues: https://github.com/shinnn/feint/issues
- npm.io page: https://npm.io/package/feint

## Dependencies (1)

- [append-type](https://npm.io/package/append-type.md) ^1.0.2

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2019-05-26
- 1.0.2 — 2018-02-26
- 1.0.1 — 2017-05-09
- 0.1.0 — 2017-05-09
- 0.0.0 — 2017-04-28

## README

# feint

[![npm version](https://img.shields.io/npm/v/feint.svg)](https://www.npmjs.com/package/feint)
[![Build Status](https://travis-ci.com/shinnn/feint.svg?branch=master)](https://travis-ci.com/shinnn/feint)
[![codecov](https://codecov.io/gh/shinnn/feint/branch/master/graph/badge.svg)](https://codecov.io/gh/shinnn/feint)

Make a given `Function` do nothing at its first call

```javascript
import feint from 'feint';

const fn = feint(() => 1);
fn(); //=> undefined
fn(); //=> 1
fn(); //=> 1
```

## Installation

[Use](https://docs.npmjs.com/cli/install) [npm]https://docs.npmjs.com/about-npm/).

```
npm install feint
```

## API

```javascript
import feint from 'feint';
```

### feint(*fn*)

*fn*: `Function`  
Return: `Function`

It returns a new `Function` that does nothing when it's called for the first time. From the second time on, the function performs normally.

```javascript
import {existsSync, mkdirSync} from 'fs';
import feint from 'feint';

const feintMkdir = feint(mkdirSync);

feintMkdir('foo');
existsSync('foo'); //=> false

feintMkdir('foo');
existsSync('foo'); //=> true
```

## License

[ISC License](./LICENSE) © 2018 - 2019 Watanabe Shinnosuke

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