# nested-camel

> Flattens a nested object tree by recursively joining and camelcasing keys.

Latest version **1.1.0** (published 2017-08-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install nested-camel
pnpm add nested-camel
yarn add nested-camel
bun add nested-camel
```

## 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.1.0 |
| Published | 2017-08-25 |
| First published | 2017-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kenneth Powers |
| Maintainers | kenpowers |

## Links

- npm: https://www.npmjs.com/package/nested-camel
- Repository: https://github.com/knpwrs/nested-camel
- Homepage: https://github.com/knpwrs/nested-camel#readme
- Issues: https://github.com/knpwrs/nested-camel/issues
- npm.io page: https://npm.io/package/nested-camel

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4

## Recent versions

- 1.1.0 (latest) — 2017-08-25
- 1.0.3 — 2017-08-25
- 1.0.2 — 2017-08-24
- 1.0.1 — 2017-08-24
- 1.0.0 — 2017-08-24

## README

# nested-camel
[![Dependency Status](https://img.shields.io/david/knpwrs/nested-camel.svg)](https://david-dm.org/knpwrs/nested-camel)
[![devDependency Status](https://img.shields.io/david/dev/knpwrs/nested-camel.svg)](https://david-dm.org/knpwrs/nested-camel#info=devDependencies)
[![Build Status](https://img.shields.io/travis/knpwrs/nested-camel.svg)](https://travis-ci.org/knpwrs/nested-camel)
[![Npm Version](https://img.shields.io/npm/v/nested-camel.svg)](https://www.npmjs.com/package/nested-camel)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Badges](https://img.shields.io/badge/badges-6-orange.svg)](http://shields.io/)

A function which flattens a nested object tree by recursively joining and
camelcasing keys. Useful as a utility for css-in-js frameworks.

## Usage

```js
import { css } from 'glamor';
import nested from 'nested-camel';

// Use it directly:
const rule = css(nested({
  font: {
    family: 'fantasy',  // fontFamily
    size: '30em',       // fontSize
    weight: 'bold',     // fontWeight
  },
  border: {
    top: {
      style: 'dashed',  // borderTopStyle
      color: 'red',     // borderTopColor
      width: 'thick',   // borderTopWidth
    },
    bottom: {
      style: 'light',   // borderBottomStyle
      color: 'blue',    // borderBottomColor
      width: 'thin',    // borderBottomWidth
    },
  },
}));

// Use it with object-rest-spread:
const rule2 = css({
  background: 'blue',    // background
  ...nested({
    font: {
      family: 'fantasy', // fontFamily
      size: '30em',      // fontSize
      weight: 'bold',    // fontWeight
    },
  }),
});

// Compose it:
import { compose } from 'ramda';
const ncss = compose(css, nested);

const rule3 = ncss({
  font: {
    family: 'fantasy',  // fontFamily
    size: '30em',       // fontSize
    weight: 'bold',     // fontWeight
  },
  border: {
    top: {
      style: 'dashed',  // borderTopStyle
      color: 'red',     // borderTopColor
      width: 'thick',   // borderTopWidth
    },
    bottom: {
      style: 'solid',   // borderBottomStyle
      color: 'blue',    // borderBottomColor
      width: 'thin',    // borderBottomWidth
    },
  },
});
```

## License

**MIT**

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