cojs / co-body

Parse request bodies with co
MIT License
325 stars 42 forks source link

Add a parameter named transformBody to parse the request body in a user-defined way #75

Closed mstar-kk closed 4 years ago

mstar-kk commented 4 years ago

Add a parameter named transformBody to parse the request body in a user-defined way. For example,

//opts
const opts = {
    transformBody: function(str) {
        const JsonBigInt = require("json-bigint");
        return JsonBigInt.parse(str);
    }
}