# noerr

> Safe property reference chaining without errors

Latest version **2.1.0** (published 2021-07-16) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2.1.0 |
| Published | 2021-07-16 |
| First published | 2017-05-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | mpyw |
| Maintainers | mpyw |
| Keywords | safe, null, undefined, error |

## Links

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

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 2.1.0 (latest) — 2021-07-16
- 2.0.1 — 2017-05-20
- 2.0.0 — 2017-05-20
- 1.0.1 — 2017-05-20
- 1.0.0 — 2017-05-20

## README

# noerr

Safe property reference chaining without errors.  
Only `TypeError` can be suppressed.

## Usage (Node & NPM)

```bash
npm install noerr
```

```js
import noerr from 'noerr';

const a = {b: 1};
console.log(noerr(() => a.b)); // 1
console.log(noerr(() => a.b.c)); // undefined
console.log(noerr(() => a.b.c.d)); // undefined
console.log(noerr(() => a.b.c())); // undefined

noerr(() => x); // ReferenceError: x is not defined
```

## Usage (Browser & CDN)

```html
<script src="https://unpkg.com/noerr@latest"></script>

<script>
const noerr = NoErr.default;

const a = {b: 1};
console.log(noerr(() => a.b)); // 1
console.log(noerr(() => a.b.c)); // undefined
console.log(noerr(() => a.b.c.d)); // undefined
console.log(noerr(() => a.b.c())); // undefined

noerr(() => x); // ReferenceError: x is not defined
</script>
```

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