content-disposition-attachment
![Build Status](https://img.shields.io/travis/lujjjh/content-disposition-attachment/master.svg?style=flat-square)
A library to parse "attachment"s in Content-Disposition.
Installation
npm install content-disposition-attachment
Getting Started
parse
Parse a Content-Disposition.
If Content-Disposition is not "attachment", it returns { attachment: false }
;
otherwise, it returns { attachment: true }
along with parsed parameters.
If errors occur when parsing parameters, a ParseError
will be thrown.
Examples
const ContentDispositionAttachment = require('content-disposition-attachment')
ContentDispositionAttachment.parse('inline')
ContentDispositionAttachment.parse('attachment; filename=foo.html; foo=bar')
ContentDispositionAttachment.parse('attachment; foo')