JSPM

http-constants-ts

1.0.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 898
  • Score
    100M100P100Q102018F
  • License ISC

Http Constants for mime-types, headers, tracking-statuses, methods, content-encodings, csp, response codes and cache-control instructions

Package Exports

  • http-constants-ts
  • http-constants-ts/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (http-constants-ts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Http constants for mime-types, headers, tracking-statuses, methods, content-encodings, csp, response codes and cache-control instructions

Provides standard and common non-standard http headers, mime-types, methods, content codings, response statuses, CSP directives and sources, cache-control instructions and tracking statuses.

All headers are capitalized, hence Access-Control-Request-Method All mime-types are lowercase, hence video/mpeg All content codings are lowercase, hence deflate All methods are uppercase, hence POST All response codes are integer numbers, hence 404 All Cache-Control instructions are lowercase, hence min-fresh All CSP directives and sources are lowercase, hence unsafe-eval

Key names constructed from uppercase values, -, + and . substituted with _, hence

Headers.STRICT_TRANSPORT_SECURITY //Strict-Transport-Security
MimeTypes.Application.XOP_XML     //application/xop+xml
MimeTypes.Model.X3D_VRML          //model/x3d+vrml
ContentEncodings.X_GZIP           //x-gzip
MimeTypes.Image.VND_WAP_WBMP      //image/vnd.wap.wbmp
ResponseCodes.I_AM_A_TEAPOT       //418
CacheControls.MAX_AGE             //max-age
CSPS.UNSAFE_EVAL                  //unsafe-eval

Usage

Install local

npm install http-headers-ts --save

Available at the moment

  • Headers - headers
  • TrackingStatuses - tracking statuses
  • Methods - http methods
  • ContentEncodings - http content coding registry
  • ResponseCodes - response codes
  • CacheControls - Cache-Control instructions
  • CSPD - CSP directives
  • CSPS - some CSP source values
  • MimeTypes - yes, mime types, fair and square

Dependencies

No additional dependencies for production.

Direct Contacts

Issues? Feel free to add a bug or create a PR.

Best regards iDschepe

What's new

1.0.0

Thanks to / forked from https://bitbucket.org/sypachev_s_s/http-headers-js