# atget

> An easier way of getting object attributes

Latest version **0.0.3** (published 2016-01-24) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2016-01-24 |
| First published | 2014-10-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Martin Freisen |
| Maintainers | eisfrei |
| Keywords | attributes, attribute |

## Links

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

## Recent versions

- 0.0.3 (latest) — 2016-01-24
- 0.0.2 — 2014-10-14
- 0.0.1 — 2014-10-14

## README

atget
=====

An easier way of getting object attributes

## Install
    
    npm install atget

## Usage

	var atget = require('atget');
	var obj = {
		a: {
			b: {
				c: 1
			}
		}
	}
	var key = 'a.b.c';
	var missingKey = 'nope.nothing.here';
	var defaultValue = 'not found';

	// call as function
	console.log(atget(obj, key));
	// returns 1

	console.log(atget(obj, key));
	// returns 1

	console.log(atget(obj, missingKey));
	// returns undefined

	console.log(atget(obj, missingKey, defaultValue));
	// returns 'not found'

	// call getter on an instance
	console.log(new atget(obj).get(key));
	// returns 1

	// call getter on an automatically created instance
	console.log(atget(obj).get(key));
	// returns 1

	console.log(atget(obj).get(missingKey, defaultValue));
	// returns 'not found'

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