Registry / storage / axios-upload

axios-upload

JSON →
library1.0.10jsnpmunverified

axios-upload is a lightweight npm package (v1.0.10) that extends axios to simplify uploading form data with file streams in Node.js. It automatically handles FormData creation and stream piping, including a default 100MB upload limit (configurable via maxContentLength). This package is designed for Node.js environments only and has a very small footprint. The release cadence is irregular; no major updates or breaking changes have been reported since initial release. It differentiates itself by providing a minimal wrapper around axios for file uploads without requiring manual FormData construction or multipart headers.

npm install axios-upload
INSTALL
IMPORT
SIG · AXIOS-UPLOAD
A
axios-upload
storagejavascriptv1.0.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import axiosUpload from 'axios-upload'
const axiosUpload = require('axios-upload')
Package is ESM-only since v1. CJS require will fail.
axiosUpload
import axiosUpload from 'axios-upload'
import { axiosUpload } from 'axios-upload'
The package exports a single default function, not a named export.
upload
import upload from 'axios-upload'
import { upload } from 'axios-upload'
The default export is the upload function; no named exports exist.

Shows how to upload a file stream with default 100MB limit using axios-upload in an async function.

import axiosUpload from 'axios-upload'; import fs from 'fs'; const data = { name: 'test', filedata: fs.createReadStream('./test.png') }; await axiosUpload({ url: 'http://example.com/upload', method: 'post', headers: { 'cache-control': 'no-cache' }, data: data // maxContentLength: 200 * 1024 * 1024 // optional, 200MB }); console.log('Upload complete');
Debug
Known issues
breakingPackage is ESM-only. require('axios-upload') will throw an error.
fix
Use import axiosUpload from 'axios-upload' instead of require.
affects: >=1.0.0
gotchaThe package does not support browser environments; it relies on Node.js stream and fs modules.
fix
Use only in Node.js projects. For browser uploads, use axios directly.
affects: *
gotchaThe default file upload limit is 100MB. Larger files will fail silently unless maxContentLength is explicitly set.
fix
Set maxContentLength in options to a higher value (in bytes) for large files.
affects: *
deprecatedThe package has not been updated since v1.0.10 (2020-01). It may become incompatible with future axios versions.
fix
Consider using axios directly with FormData for better maintainability.
affects: >=1.0.10
Errors
Common errors & fixes
require('axios-upload') is not a function
Package is ESM-only, cannot be required with CommonJS require.
fix
Change to import axiosUpload from 'axios-upload' in an ESM context, or use dynamic import.
ReferenceError: Buffer is not defined in browser
Package uses Node.js built-in buffer and stream modules, not available in browsers.
fix
Use axios directly with FormData for browser uploads.
Request failed with status code 413 (Payload Too Large) using axios-upload
Uploaded file exceeds the default 100MB limit and the server enforces a lower limit, or maxContentLength not set.
fix
Set maxContentLength: 200 * 1024 * 1024 (for 200MB) in the options passed to axios-upload.
Upgrade
Version history
1.0.10latest on npm
Audit
Dependencies
axiosrequiredaxios-upload is a wrapper around axios for upload functionality
Agent activity
32 hits · last 30 days
node
26
Resources
axios-upload — npm install axios-upload · libregistry