brackets2dots
Version:
Convert string with bracket notation to dot property notation for Node.js and the browser.
54 lines (28 loc) • 1.5 kB
Markdown
# brackets2dots.js
[](https://travis-ci.org/wilmoore/brackets2dots.js) [](https://www.npmjs.org/package/brackets2dots) [](https://www.npmjs.org/package/brackets2dots) [](license)
> Convert string with bracket notation to dot property notation for [Node.js][] and the browser.
## Example
var brackets2dots = require('brackets2dots');
brackets2dots('group[0].section.a.seat[3]')
//=> 'group.0.section.a.seat.3'
## Installation
[component](http://component.io/wilmoore/brackets2dots)
$ component install wilmoore/brackets2dots
[bower](http://sindresorhus.com/bower-components/)
$ bower install brackets2dots.js
[npm](https://npmjs.org/package/brackets2dots)
[](https://nodei.co/npm/brackets2dots/)
[volo](http://volojs.org)
$ volo add wilmoore/brackets2dots.js
[manual][]
1. download
% curl -#O https://raw.github.com/wilmoore/brackets2dots.js/master/brackets2dots.js
2. use
<script src="brackets2dots.js"></script>
## Inspiration
- [selectn][]
## License
[MIT](license)
[selectn]: https://github.com/wilmoore/selectn
[Node.js]: http://nodejs.org
[manual]: http://yuiblog.com/blog/2006/06/01/global-domination/