Modules@robinpath/form

@robinpath/form

0.1.0Public

Multipart form data builder and file upload handling

@robinpath/form

Multipart form data builder, file uploads, URL encoding/decoding, and form submission

Category Functions Auth License

Why use this module?

The form module lets you:

  • Create a FormData object from key-value pairs
  • Add a text field to a FormData
  • Add a file to a FormData
  • Submit a FormData to a URL
  • URL-encode an object as application/x-www-form-urlencoded

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

npm install @robinpath/form

Quick Start

No credentials needed — start using it right away:

form.addField $form "name" "Alice"

Available Functions

FunctionDescription
form.createCreate a FormData object from key-value pairs
form.addFieldAdd a text field to a FormData
form.addFileAdd a file to a FormData
form.submitSubmit a FormData to a URL
form.encodeURL-encode an object as application/x-www-form-urlencoded
form.decodeDecode a URL-encoded form body
form.uploadFileUpload a file to a URL as multipart form
form.parseMultipartParse a multipart form body

Examples

Add a text field to a FormData

form.addField $form "name" "Alice"

Add a file to a FormData

form.addFile $form "avatar" "./photo.jpg"

Submit a FormData to a URL

form.submit "https://api.example.com/upload" $form

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/form";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  form.addField $form "name" "Alice"
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.0latestyesterday
Install
$ robinpath install @robinpath/form
Version0.1.0
LicenseMIT
Unpacked Size4.7 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

web