Nonchalantly Performs Magic

    tiz-multer

    0.0.8 • Public • Published

    tiz-multer

    multipart tool for tiz

    Install

    $ npm i tiz-multer -S

    Usage

    per route middleware as multer do

    const multer = require('tiz-multer')
    const upload = multer({
      dest: '/data/uploads'
    })
     
    router.get('/upload', upload.single('image'), async ctx => {
      // blabla
    })

    as plugin add ctx.upload method

    router.get('/upload', async ctx => {
      try {
        await ctx.uploadSingle('image', {
          /* multer options */
          dest: '/uploads/dir'
        })
      } catch (e) {
     
      }
    })

    Install

    npm i tiz-multer

    DownloadsWeekly Downloads

    4

    Version

    0.0.8

    License

    MIT

    Last publish

    Collaborators

    • avatar