# esformatter-dot-notation

> esformatter plugin for transforming object bracket usage to dot notation

Latest version **1.3.1** (published 2015-05-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install esformatter-dot-notation
pnpm add esformatter-dot-notation
yarn add esformatter-dot-notation
bun add esformatter-dot-notation
```

## 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.3.1 |
| Published | 2015-05-28 |
| First published | 2014-08-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Gilad Peleg |
| Maintainers | pgilad |
| Keywords | esformatter, esformatter-plugin, string, dot-notation, literal, AST, rocambole, esprima, codestyle |

## Links

- npm: https://www.npmjs.com/package/esformatter-dot-notation
- Repository: https://github.com/pgilad/esformatter-dot-notation
- Homepage: https://github.com/pgilad/esformatter-dot-notation#readme
- Issues: https://github.com/pgilad/esformatter-dot-notation/issues
- npm.io page: https://npm.io/package/esformatter-dot-notation

## Dependencies (3)

- [rocambole](https://npm.io/package/rocambole.md) ^0.6.0
- [rocambole-token](https://npm.io/package/rocambole-token.md) ^1.2.1
- [unquoted-property-validator](https://npm.io/package/unquoted-property-validator.md) ^1.0.0

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.3.1 (latest) — 2015-05-28
- 1.3.0 — 2015-05-14
- 1.2.0 — 2015-05-08
- 1.1.0 — 2014-11-09
- 1.0.0 — 2014-10-27
- 0.2.0 — 2014-10-08
- 0.1.2 — 2014-08-30
- 0.1.1 — 2014-08-29

## README

# [esformatter](https://github.com/millermedeiros/esformatter)-dot-notation

> esformatter plugin for transforming object bracket usage to dot notation

[![NPM Version](http://img.shields.io/npm/v/esformatter-dot-notation.svg?style=flat)](https://npmjs.org/package/esformatter-dot-notation)
[![NPM Downloads](http://img.shields.io/npm/dm/esformatter-dot-notation.svg?style=flat)](https://npmjs.org/package/esformatter-dot-notation)
[![Build Status](http://img.shields.io/travis/pgilad/esformatter-dot-notation.svg?style=flat)](https://travis-ci.org/pgilad/esformatter-dot-notation)

**esformatter-dot-notation** is a plugin for [esformatter](https://github.com/millermedeiros/esformatter)
meant to convert accessing object properties with brackets into dot notation where valid.

This module uses [unquoted-property-validator](https://github.com/pgilad/unquoted-property-validator) which uses Mathias Bynens
[implementation](https://github.com/mathiasbynens/mothereff.in/tree/master/js-properties)
in order to validate if a property name is a valid identifier name and can be used with dot notation.

That means invalid identifiers will not be converted and your code is safe for transformations (see [tests](tests/compare.spec.js)).

Turn this:
```js
someObject['property'] = true;
```

into:
```js
someObject.property = true;
```

## Installation

```sh
$ npm install esformatter-dot-notation --save-dev
```

## Config

Newest esformatter versions autoload plugins from your `node_modules` [See this](https://github.com/millermedeiros/esformatter#plugins)

Add to your esformatter config file:

```json
{
  "plugins": [
    "esformatter-dot-notation"
  ]
}
```

Or you can manually register your plugin:
```js
var dotNotation = require('esformatter-dot-notation');
// register plugin
esformatter.register(dotNotation);
```

## Usage

```js
var fs = require('fs');
var esformatter = require('esformatter');
//register plugin manually
esformatter.register(require('esformatter-dot-notation'));

var str = fs.readFileSync('someKewlFile.js').toString();
var output = esformatter.format(str);
//-> output will now contain the formatted string
```

See [esformatter](https://github.com/millermedeiros/esformatter) for more options and further usage.

## License

MIT @[Gilad Peleg](http://giladpeleg.com)

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