# truthy-keys

> Creates an array of the own enumerable property names of an object for which the values are truthy.

Latest version **0.1.3** (published 2018-01-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install truthy-keys
pnpm add truthy-keys
yarn add truthy-keys
bun add truthy-keys
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2018-01-22 |
| First published | 2017-09-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jed Mao |
| Maintainers | jedmao |
| Keywords | truthy, keys, object |

## Links

- npm: https://www.npmjs.com/package/truthy-keys
- Repository: https://github.com/jedmao/truthy-keys
- Homepage: https://github.com/jedmao/truthy-keys#readme
- Issues: https://github.com/jedmao/truthy-keys/issues
- npm.io page: https://npm.io/package/truthy-keys

## Recent versions

- 0.1.3 (latest) — 2018-01-22
- 0.1.2 — 2017-09-29
- 0.1.1 — 2017-09-29
- 0.1.0 — 2017-09-29

## README

# truthy-keys

[![NPM version](http://img.shields.io/npm/v/truthy-keys.svg?style=flat)](https://www.npmjs.org/package/truthy-keys)
[![npm license](http://img.shields.io/npm/l/truthy-keys.svg?style=flat-square)](https://www.npmjs.org/package/truthy-keys)
[![Travis Build Status](https://img.shields.io/travis/jedmao/truthy-keys.svg)](https://travis-ci.org/jedmao/truthy-keys)
[![Dependency Status](https://gemnasium.com/badges/github.com/jedmao/truthy-keys.svg)](https://gemnasium.com/github.com/jedmao/truthy-keys)

[![npm](https://nodei.co/npm/truthy-keys.svg?downloads=true)](https://nodei.co/npm/truthy-keys/)

Creates an array of the own enumerable property names of an object for which the values are truthy.

## Installation

```
$ npm install truthy-keys
```

## Usage examples

```ts
truthyKeys({ foo: true, bar: false });
// ["foo"]

truthyKeys('foo');
// ["0", "1", "2"]

truthyKeys(/* any falsey value */);
// []

truthyKeys(42);
// []
```

See [the tests](https://github.com/jedmao/truthy-keys/blob/master/src/index.test.ts).


## Testing

Run the following command:

```
$ npm test
```

This will build scripts, run tests and generate a code coverage report. Anything less than 100% coverage will throw an error.

### Watching

For much faster development cycles, run the following commands in 2 separate processes:

```
$ npm run build:watch
```

Compiles TypeScript source into the `./dist` folder and watches for changes.

```
$ npm run watch
```

Runs the tests in the `./dist` folder and watches for changes.

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