Skip to content

Commit

Permalink
Updated README.md usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
pichillilorenzo committed Sep 29, 2022
1 parent 5f4f831 commit 6d17af7
Show file tree
Hide file tree
Showing 10 changed files with 2,473 additions and 25 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.2

- Updated README.md usage example

## 1.0.1

- Fixed package.json metadata
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ https://cdn.jsdelivr.net/gh/pichillilorenzo/http-status-code-db@main/dist/db.jso
```js
import db from 'http-status-code-db';
// .. or
const db = require('http-status-code-db');
const db = require('http-status-code-db').default;

const statusCodeInfo = db['200']; // An instance of HTTPStatusCode
console.log(statusCodeInfo.syntax); // 200 OK
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h3>Database Download</h3>
<a href="#usage" id="usage" style="color: inherit; text-decoration: none;">
<h2>Usage</h2>
</a>
<pre><code class="language-js"><span class="hl-3">import</span><span class="hl-0"> </span><span class="hl-4">db</span><span class="hl-0"> </span><span class="hl-3">from</span><span class="hl-0"> </span><span class="hl-5">&#39;http-status-code-db&#39;</span><span class="hl-0">;</span><br/><span class="hl-2">// .. or</span><br/><span class="hl-6">const</span><span class="hl-0"> </span><span class="hl-7">db</span><span class="hl-0"> = </span><span class="hl-8">require</span><span class="hl-0">(</span><span class="hl-5">&#39;http-status-code-db&#39;</span><span class="hl-0">);</span><br/><br/><span class="hl-6">const</span><span class="hl-0"> </span><span class="hl-7">statusCodeInfo</span><span class="hl-0"> = </span><span class="hl-4">db</span><span class="hl-0">[</span><span class="hl-5">&#39;200&#39;</span><span class="hl-0">]; </span><span class="hl-2">// An instance of HTTPStatusCode</span><br/><span class="hl-4">console</span><span class="hl-0">.</span><span class="hl-8">log</span><span class="hl-0">(</span><span class="hl-4">statusCodeInfo</span><span class="hl-0">.</span><span class="hl-4">syntax</span><span class="hl-0">); </span><span class="hl-2">// 200 OK</span>
<pre><code class="language-js"><span class="hl-3">import</span><span class="hl-0"> </span><span class="hl-4">db</span><span class="hl-0"> </span><span class="hl-3">from</span><span class="hl-0"> </span><span class="hl-5">&#39;http-status-code-db&#39;</span><span class="hl-0">;</span><br/><span class="hl-2">// .. or</span><br/><span class="hl-6">const</span><span class="hl-0"> </span><span class="hl-7">db</span><span class="hl-0"> = </span><span class="hl-8">require</span><span class="hl-0">(</span><span class="hl-5">&#39;http-status-code-db&#39;</span><span class="hl-0">).</span><span class="hl-4">default</span><span class="hl-0">;</span><br/><br/><span class="hl-6">const</span><span class="hl-0"> </span><span class="hl-7">statusCodeInfo</span><span class="hl-0"> = </span><span class="hl-4">db</span><span class="hl-0">[</span><span class="hl-5">&#39;200&#39;</span><span class="hl-0">]; </span><span class="hl-2">// An instance of HTTPStatusCode</span><br/><span class="hl-4">console</span><span class="hl-0">.</span><span class="hl-8">log</span><span class="hl-0">(</span><span class="hl-4">statusCodeInfo</span><span class="hl-0">.</span><span class="hl-4">syntax</span><span class="hl-0">); </span><span class="hl-2">// 200 OK</span>
</code></pre>
<p>Access HTTP Status Code info using the status code number as a key.</p>

Expand Down
24 changes: 12 additions & 12 deletions docs/interfaces/HTTPStatusCode.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h4>Hierarchy</h4>
<ul class="tsd-hierarchy">
<li><span class="target">HTTPStatusCode</span></li></ul></section><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/91b6765/src/main.ts#L217">main.ts:217</a></li></ul></aside>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/5f4f831/src/main.ts#L217">main.ts:217</a></li></ul></aside>
<section class="tsd-panel-group tsd-index-group">
<section class="tsd-panel tsd-index-panel">
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
Expand Down Expand Up @@ -52,77 +52,77 @@ <h3 class="tsd-anchor-link"><span>browser<wbr/>Compatibility</span><a href="#bro
<div class="tsd-comment tsd-typography"><p>HTTP Status Code features browser compatibility list.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/91b6765/src/main.ts#L271">main.ts:271</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/5f4f831/src/main.ts#L271">main.ts:271</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="code" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>code</span><a href="#code" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">code<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<div class="tsd-comment tsd-typography"><p>HTTP Status code.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/91b6765/src/main.ts#L221">main.ts:221</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/5f4f831/src/main.ts#L221">main.ts:221</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="description" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>description</span><a href="#description" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">description<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div>
<div class="tsd-comment tsd-typography"><p>HTTP Status Code description.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/91b6765/src/main.ts#L231">main.ts:231</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/5f4f831/src/main.ts#L231">main.ts:231</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="examples" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>examples</span><a href="#examples" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">examples<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div>
<div class="tsd-comment tsd-typography"><p>HTTP Status Code examples.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/91b6765/src/main.ts#L261">main.ts:261</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/5f4f831/src/main.ts#L261">main.ts:261</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="experimental" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>experimental</span><a href="#experimental" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">experimental<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div>
<div class="tsd-comment tsd-typography"><p>If set, this HTTP Status Code is experimental. The string represents the documentation description.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/91b6765/src/main.ts#L251">main.ts:251</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/5f4f831/src/main.ts#L251">main.ts:251</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="link" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>link</span><a href="#link" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">link<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div>
<div class="tsd-comment tsd-typography"><p>HTTP Status Code documentation link.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/91b6765/src/main.ts#L241">main.ts:241</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/5f4f831/src/main.ts#L241">main.ts:241</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="note" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>note</span><a href="#note" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">note<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div>
<div class="tsd-comment tsd-typography"><p>HTTP Status Code note.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/91b6765/src/main.ts#L236">main.ts:236</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/5f4f831/src/main.ts#L236">main.ts:236</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="reasonPhrase" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>reason<wbr/>Phrase</span><a href="#reasonPhrase" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">reason<wbr/>Phrase<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<div class="tsd-comment tsd-typography"><p>HTTP Status Code Reason Phrase.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/91b6765/src/main.ts#L226">main.ts:226</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/5f4f831/src/main.ts#L226">main.ts:226</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="specifications" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>specifications</span><a href="#specifications" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">specifications<span class="tsd-signature-symbol">:</span> <a href="HTTPStatusCodeSpecification.html" class="tsd-signature-type" data-tsd-kind="Interface">HTTPStatusCodeSpecification</a><span class="tsd-signature-symbol">[]</span></div>
<div class="tsd-comment tsd-typography"><p>HTTP Status Code specifications.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/91b6765/src/main.ts#L266">main.ts:266</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/5f4f831/src/main.ts#L266">main.ts:266</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="syntax" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>syntax</span><a href="#syntax" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">syntax<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div>
<div class="tsd-comment tsd-typography"><p>HTTP Status Code syntax example.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/91b6765/src/main.ts#L246">main.ts:246</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/5f4f831/src/main.ts#L246">main.ts:246</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="warning" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>warning</span><a href="#warning" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">warning<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div>
<div class="tsd-comment tsd-typography"><p>If set, it represents a warning message for this HTTP Status Code.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/91b6765/src/main.ts#L256">main.ts:256</a></li></ul></aside></section></section></div>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/5f4f831/src/main.ts#L256">main.ts:256</a></li></ul></aside></section></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
Expand Down
8 changes: 4 additions & 4 deletions docs/interfaces/HTTPStatusCodeBrowserInfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h4>Hierarchy</h4>
<ul class="tsd-hierarchy">
<li><span class="target">HTTPStatusCodeBrowserInfo</span></li></ul></section><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/91b6765/src/main.ts#L122">main.ts:122</a></li></ul></aside>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/5f4f831/src/main.ts#L122">main.ts:122</a></li></ul></aside>
<section class="tsd-panel-group tsd-index-group">
<section class="tsd-panel tsd-index-panel">
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
Expand All @@ -44,21 +44,21 @@ <h3 class="tsd-anchor-link"><span>name</span><a href="#name" aria-label="Permali
<div class="tsd-comment tsd-typography"><p>HTTP Status Code browser info name.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/91b6765/src/main.ts#L126">main.ts:126</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/5f4f831/src/main.ts#L126">main.ts:126</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="supported" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>supported</span><a href="#supported" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">supported<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span></div>
<div class="tsd-comment tsd-typography"><p>If the HTTP Status Code is supported by the browser.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/91b6765/src/main.ts#L136">main.ts:136</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/5f4f831/src/main.ts#L136">main.ts:136</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="version" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>version</span><a href="#version" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">version<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<div class="tsd-comment tsd-typography"><p>HTTP Status Code browser info label version.</p>
</div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/91b6765/src/main.ts#L131">main.ts:131</a></li></ul></aside></section></section></div>
<li>Defined in <a href="https://github.com/pichillilorenzo/http-status-code-db/blob/5f4f831/src/main.ts#L131">main.ts:131</a></li></ul></aside></section></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
Expand Down
Loading

0 comments on commit 6d17af7

Please sign in to comment.