content-disposition
- Version 2.0.0
- Published
- 48.3 kB
- No dependencies
- MIT license
Install
npm i content-dispositionyarn add content-dispositionpnpm add content-dispositionOverview
Create and parse Content-Disposition header
Index
Functions
function create
create: (filename?: string, options?: CreateOptions) => string;Create an attachment Content-Disposition header.
function decodeExtended
decodeExtended: (str: string) => string | undefined;Decode a RFC 8187 field value (gracefully).
function encodeExtended
encodeExtended: (str: string) => string;Encode a Unicode string for HTTP (RFC 5987).
function format
format: (obj: Partial<ContentDisposition>, options?: FormatOptions) => string;Format object to Content-Disposition header.
function parse
parse: (header: string, options?: ParseOptions) => ContentDisposition;Parse Content-Disposition header string.
Interfaces
interface ContentDisposition
interface ContentDisposition {}property parameters
parameters: Record<string, string>;Content-Disposition parameters, such as "filename"
property type
type: string;Content-Disposition type, such as "attachment" or "inline"
interface CreateOptions
interface CreateOptions {}property fallback
fallback?: string | boolean;Fallback filename for non-US-ASCII strings. If true, a fallback will be generated by replacing non-US-ASCII characters with "?". If false, no fallback will be generated. true
property type
type?: string;Content-Disposition type, defaults to "attachment" "attachment"
interface FormatOptions
interface FormatOptions {}interface ParseOptions
interface ParseOptions {}Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (4)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/content-disposition.
- Markdown[](https://www.jsdocs.io/package/content-disposition)
- HTML<a href="https://www.jsdocs.io/package/content-disposition"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 2453 ms. - Missing or incorrect documentation? Open an issue for this package.
