# @knowdev/functions

> Helpful functions

Latest version **1.0.0** (published 2023-07-24) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install @knowdev/functions
pnpm add @knowdev/functions
yarn add @knowdev/functions
bun add @knowdev/functions
```

## 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 | 2023-07-24 |
| First published | 2021-11-01 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Adam Finlayson |
| Maintainers | nullfame |

## Links

- npm: https://www.npmjs.com/package/@knowdev/functions
- npm.io page: https://npm.io/package/@knowdev/functions

## Recent versions

- 1.0.0 (latest) — 2023-07-24
- 0.2.1 — 2021-11-06
- 0.1.0 — 2021-11-01

## README

# KnowDev Functions 🧰

## 📋 Usage

``` bash
npm install --save @knowdev/functions
```

## 📖 Reference

### envBoolean

Look up a key in `process.env` and coerce it into a boolean.
Returns `true` for `true` (case-insensitive) and `1` for string, boolean, and numeric types.
Returns `false` for `false` (case-insensitive) and `0` for string, boolean, and numeric types.
Returns `undefined` otherwise.

``` javascript
const { envBoolean } = require("@knowdev/functions");

process.env.AWESOME = true;

if (envBoolean("AWESOME")) {
  console.log("Awesome!");
}
```

#### envBoolean: defaultValue

``` javascript
const { envBoolean } = require("@knowdev/functions");

if (envBoolean("AWESOME", { defaultValue: true })) {
  console.log("Awesome!");
}
```

### getObjectKeyCaseInsensitive

``` javascript
const { getObjectKeyCaseInsensitive } = require("@knowdev/functions");

const object = { one: 1 };
getObjectKeyCaseInsensitive(object, "ONE"); // 1
```

## 🚀 Deployment

`npm publish --access=public`

## 📝 Changelog

* 0.2.0: getObjectKeyCaseInsensitive
* 0.1.0: envBoolean

## 📜 License

All rights reserved. Safe for use around pets.

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