Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
object-to-form
Advanced tools
Readme
Convert an object to formdata
$ npm install --save object-to-form
Convert an object
// 3.- ES2015
import { objectToForm } from 'object-to-form';
let obj = {
name: 'myName',
list: [
'Item1',
'Item2',
'Item3',
],
address: {
street: 'myStreet'
},
photo: new File() // File object
};
let formData = objectToForm(obj);
You can pass a formdata previously created
// 3.- ES2015
import { objectToForm } from 'object-to-form';
// formdata previously created.
let previousFormData = new FormData();
// the previous formdata can has fields added
previousFormData.append('field1', 'Hi!');
let obj = {
name: 'myName',
list: [
'Item1',
'Item2',
'Item3',
],
address: {
street: 'myStreet'
},
photo: new File() // File object
};
// pass the previous formdata
let formData = objectToForm(obj, previousFormData);
NOTE: This package supports FileList on properties
// For Example
let obj = {
// FileList
myFiles: [
new File(),
new File()
]
};
NOTE: The source code code is in typescript and transpilated to Javascript. If you wish colaborate, you can make a pull request on Github.
You can execute this command for build
$ npm run build
FAQs
Convert an object to formdata.
The npm package object-to-form receives a total of 27 weekly downloads. As such, object-to-form popularity was classified as not popular.
We found that object-to-form demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.