net4j-formatter-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.0.12 • Public • Published

net4j-formatter-plugin

Format response data.

import Net from 'net4j';
import NetFormatter, { FormatterConfig } from 'net4j-formatter-plugin';

const net = new Net({
  plugins: [
    new NetFormatter({
      formatter: (res) => {
        return {
          myData: res.data
        }
      }
    }),
  ]
});


const res = await net.get('api/goods', {params: {id: 1}});

console.log(res.myData)

Readme

Keywords

Package Sidebar

Install

npm i net4j-formatter-plugin

Weekly Downloads

1

Version

1.0.12

License

MIT

Unpacked Size

3.81 kB

Total Files

5

Last publish

Collaborators

  • forthedamn