GithubHelp home page GithubHelp logo

hugoalh-studio / http-header-retry-after-es Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 38 KB

An ES (JavaScript & TypeScript) module to handle the HTTP header `Retry-After` according to the specification RFC 9110.

License: Other

TypeScript 100.00%
es header http javascript js modulejs retry-after ts typescript

http-header-retry-after-es's Introduction

HTTP Header Retry-After (ES)

⚖ī¸ MIT

GitHub: hugoalh-studio/http-header-retry-after-es JSR: @hugoalh/http-header-retry-after NPM: @hugoalh/http-header-retry-after

An ES (JavaScript & TypeScript) module to handle the HTTP header Retry-After according to the specification RFC 9110.

🔰 Begin

đŸŽ¯ Targets

Registry - JSR Registry - NPM Remote Import
Bun >= v1.1.0 ✔ī¸ node_modules ✔ī¸ Specifier npm: ❌
Cloudflare Workers ✔ī¸ node_modules ✔ī¸ node_modules ❌
Deno >= v1.42.0 ✔ī¸ Specifier jsr: ✔ī¸ Specifier npm: ✔ī¸
NodeJS >= v16.13.0 ✔ī¸ node_modules ✔ī¸ node_modules ❌

ℹī¸ Note

It is possible to use this module in other methods/ways which not listed in here, however it is not officially supported.

#ī¸âƒŖ Registries Identifier

  • JSR:
    @hugoalh/http-header-retry-after
    
  • NPM:
    @hugoalh/http-header-retry-after
    

ℹī¸ Note

  • Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit file jsr.jsonc property exports for available sub paths.
  • It is recommended to use this module with tag for immutability.

#ī¸âƒŖ Remote Import Paths

  • GitHub Raw: (Require Tag)
    https://raw.githubusercontent.com/hugoalh-studio/http-header-retry-after-es/${Tag}/mod.ts
    

ℹī¸ Note

  • Although it is recommended to import the entire module with the main path mod.ts, it is also able to import part of the module with sub path if available, but do not import if:

    • it's file path has an underscore prefix (e.g.: _foo.ts, _util/bar.ts), or
    • it is a benchmark or test file (e.g.: foo.bench.ts, foo.test.ts), or
    • it's symbol has an underscore prefix (e.g.: export function _baz() {}).

    These elements are not considered part of the public API, thus no stability is guaranteed for them.

  • Although there have 3rd party services which provide enhanced, equal, or similar methods/ways to remote import the module, beware these services maybe inject unrelated elements and thus affect the security.

🛡ī¸ Permissions

This module does not require any permission.

🧩 APIs

  • class HTTPHeaderRetryAfter {
      constructor(input: number | string | Date | Headers | HTTPHeaderRetryAfter | Response): this;
      getDate(): Date;
      getRemainTimeMilliseconds(): number;
      getRemainTimeSeconds(): number;
    }

ℹī¸ Note

For the prettier documentation, can visit via:

✍ī¸ Examples

  • new HTTPHeaderRetryAfter("Wed, 21 Oct 2015 07:28:00 GMT").getRemainTimeMilliseconds();
    //=> 0
  • new HTTPHeaderRetryAfter("120");

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.