formdata-json
v1.0.0
Published
Converts FormData entries to JSON
Downloads
1,008
Maintainers
Readme
formdata-json
Converts FormData.entities()
to JSON.
Install
npm i formdata-json --save-dev
Usage
/**
* Convert FormData elements to JSON
* @param {FormData} formData An object that is an instance of FormData
*/
** Example **
const formDataJSON = require('formdata-json')
const formData = new FormData()
formData.set('name', 'James')
formData.set('username', 'JamesTheHacker')
const result = fromDataJSON(formData)
/* Results in: */
{
name: 'James',
username: 'JamesTheHacker')
}
Known Issues
- WIP Does not support nested elements