traeger

0.1.0 • Public • Published

traeger

traeger is an axios interceptor that converts File objects into base64 encoded strings in deeply nested request data.

Usage

Use traeger as a request interceptor with axios (or a custom instance of axios).

import axios from 'axios'
import traeger from 'traeger'
 
axios.interceptors.request.use(traeger);
 
const pawneeBudget = new File(["parks,1000000\nrecreation,1000000"], "budget.csv", {
  type: "text/csv",
});
 
const data = {
  audit: {
    city: "Pawnee",
    state: "Indiana",
    budget: pawneeBudget
  }
}
 
axios.post('/', data)

Readme

Keywords

none

Package Sidebar

Install

npm i traeger

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

112 kB

Total Files

6

Last publish

Collaborators

  • noahlitvin