{"library":"form-auto-content","type":"library","category":null,"description":"form-auto-content is a utility library designed to simplify the creation of HTTP request payloads for web applications, intelligently determining the correct `Content-Type` header and payload format. It automatically switches between `application/x-www-form-urlencoded` and `multipart/form-data` based on the input data: if JavaScript `Stream` objects or `Buffer` instances are present within the input, it defaults to `multipart/form-data` for handling file uploads; otherwise, it constructs a standard `x-www-form-urlencoded` string. The current stable version is 3.2.1, indicating active development with a release cadence that includes minor and patch updates for new features, dependency management, and bug fixes, typically released as needed rather than on a fixed schedule. A key differentiator is its robust auto-sensing capability, allowing developers to pass a single JavaScript object without explicitly specifying the `enctype`. It gracefully handles complex data structures, including nested arrays, and supports advanced file options like custom filenames and content types for `multipart` fields. This makes it particularly useful for interacting with HTTP servers, especially within Node.js environments for server-side forms or API client libraries, and it integrates well with frameworks like Fastify and testing utilities such as `light-my-request`. The library also provides an API to customize the output field names for the generated payload stream and headers object.","language":"javascript","status":"active","version":"3.2.1","tags":["javascript","form","form-auto-content","x-www-form-urlencoded","multipart","form-data","form-enctype","enctype","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install form-auto-content","imports":["import formAutoContent from 'form-auto-content';","const formAutoContent = require('form-auto-content');","const options = { payload: 'body', headers: 'head' } as const;\nconst form = formAutoContent(data, options);"]},{"cmd":"yarn add form-auto-content","imports":[]},{"cmd":"pnpm add form-auto-content","imports":[]}],"homepage":null,"github":"https://github.com/Eomm/form-auto-content","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/form-auto-content","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/form-auto-content/compatibility"}}