Skip to content

2.0.1

Choose a tag to compare

@octet-stream octet-stream released this 28 Dec 15:06

Update

  • Fix arguments passing in constructor allowing to set the options arguments for form-data fields given to constructor
import {createReadStream, statSync} from "fs"

import FormData from "formdata-node"

const fd = new FormData([
  {
    name: "file",
    value: createReadStream("/path/to/file"),

    // Here you can set field's options
    options: {
      size: statSync("/path/to/file").size
    }
  }
])

Remove


All changes: v2.0.0...v2.0.1