# wwl-js-utils

> | Current Version | Master | Develop | |-----------------|--------|---------| | [![npm version](https://badge.fury.io/js/wwl-js-utils.svg)](https://badge.fury.io/js/wwl-js-utils) | [![Build Status](https://travis-ci.org/wonderweblabs/wwl-js-utils.svg?bran

Latest version **0.1.3** (published 2016-05-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install wwl-js-utils
pnpm add wwl-js-utils
yarn add wwl-js-utils
bun add wwl-js-utils
```

## 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.1.3 |
| Published | 2016-05-03 |
| First published | 2016-04-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | wonderweblabs |
| Maintainers | cocodercoder, wwlromain, wwlsascha |

## Links

- npm: https://www.npmjs.com/package/wwl-js-utils
- npm.io page: https://npm.io/package/wwl-js-utils

## Dependencies (4)

- [q](https://npm.io/package/q.md) >=2.0.3
- [deepmerge](https://npm.io/package/deepmerge.md) ^0.2.10
- [underscore](https://npm.io/package/underscore.md) ^1.8.3
- [tiny-cookie](https://npm.io/package/tiny-cookie.md) ^0.5.5

## Recent versions

- 0.1.3 (latest) — 2016-05-03
- 0.1.2 — 2016-04-05

## README

# WWL JS Utils

| Current Version | Master | Develop |
|-----------------|--------|---------|
| [![npm version](https://badge.fury.io/js/wwl-js-utils.svg)](https://badge.fury.io/js/wwl-js-utils) | [![Build Status](https://travis-ci.org/wonderweblabs/wwl-js-utils.svg?branch=master)](https://travis-ci.org/wonderweblabs/wwl-js-utils) | [![Build Status](https://travis-ci.org/wonderweblabs/wwl-js-utils.svg?branch=develop)](https://travis-ci.org/wonderweblabs/wwl-js-utils) |

---


## settings

Loading configurations/settings over cookie or script tag or by passing in the config directly.

### Options

```coffeescript
new (require('wwl-js-utils/lib/settings'))({
  # one of those is required:
  data:         { test: 1 }
  cookieKey:    'id-of-config-cookie-key'
  selectorId:   'id-of-config-script-tag'

  # optional:
  defaults:     { some: 'defaults' }    # default: {}
  base64:       false                   # default: false
  removeAfterParse: true                # default: true
})
```

If you pass in ```data```, ```selectorId``` and ```cookieKey```, ```data``` will be used. If you pass ```selectorId``` and ```cookieKey```, ```cookieKey``` will be used.

### Getting config attributes

```coffeescript
data =
  a:
    b: 1
    c:
      d: '2'
    e:
      f: 4
      g: false

config = new (require('wwl-js-utils/settings'))({ data: data })

config.get('a').b     # 1
config.get('a').c.d   # '2'
config.get('a').e.f   # 4
config.get('a').e.g   # false
config.get('a.b')     # 1
config.get('a.c.d')   # '2'
config.get('a.e.f')   # 4
config.get('a.e.g')   # false

```

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