@f/form-controls

Retrieve a list of controls from a form

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
10Feb 9, 2016Feb 9, 2016Minified + gzip package size for @f/form-controls in KB

Readme

form-controls

Build status Git tag NPM version Code style

Retrieve a list of control elements from a form

Installation

$ npm install @f/form-controls

Usage

var controls = require('@f/form-controls')

function serialize (form) {
  return controls
    .reduce(function (acc, ctrl) {
      acc[ctrl.name] = ctrl.value
      return acc
    }, {})
}

API

formControls(form)

Returns: An array of input controls within form.

License

MIT

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.