qrcodefyi 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FYIPedia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,89 @@
1
+ # qrcodefyi
2
+
3
+ [![npm](https://img.shields.io/npm/v/qrcodefyi)](https://www.npmjs.com/package/qrcodefyi)
4
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.7-blue)](https://www.typescriptlang.org/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
+ [![Zero Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)](https://www.npmjs.com/package/qrcodefyi)
7
+
8
+ TypeScript API client for [QRCodeFYI](https://qrcodefyi.com) -- the comprehensive QR code reference covering QR code types (Model 1, Model 2, Micro QR, rMQR), 40 versions, 4 encoding modes, 4 error correction levels, ISO/IEC 18004 standards, and real-world use cases. Zero dependencies, uses native `fetch`.
9
+
10
+ > **Explore QR codes at [qrcodefyi.com](https://qrcodefyi.com)** -- [Types](https://qrcodefyi.com/types/) | [Versions](https://qrcodefyi.com/versions/) | [Glossary](https://qrcodefyi.com/glossary/) | [API Docs](https://qrcodefyi.com/developers/)
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ npm install qrcodefyi
16
+ ```
17
+
18
+ Works in Node.js, Deno, Bun, and browsers (ESM).
19
+
20
+ ## Quick Start
21
+
22
+ ```typescript
23
+ import { QRCodeFYI } from "qrcodefyi";
24
+
25
+ const api = new QRCodeFYI();
26
+
27
+ // Search QR code types, versions, encodings
28
+ const results = await api.search("micro qr");
29
+
30
+ // Get QR code type detail
31
+ const model2 = await api.qrType("model-2");
32
+ console.log(model2.error_correction_levels); // ["L", "M", "Q", "H"]
33
+
34
+ // Get version detail with data capacities
35
+ const v10 = await api.version(10);
36
+ console.log(v10.numeric_capacity);
37
+
38
+ // Compare two QR code types
39
+ const comparison = await api.compare("model-2", "micro-qr");
40
+ ```
41
+
42
+ ## API Methods
43
+
44
+ | Method | Description |
45
+ |--------|-------------|
46
+ | `search(query)` | Search types, versions, encodings, glossary |
47
+ | `glossaryTerm(slug)` | Get glossary term definition |
48
+ | `qrType(slug)` | QR code type detail |
49
+ | `version(version)` | QR code version detail by number |
50
+ | `component(slug)` | QR code component detail |
51
+ | `encoding(slug)` | Encoding mode detail |
52
+ | `standard(slug)` | Standard detail |
53
+ | `useCase(slug)` | Use case detail |
54
+ | `compare(slugA, slugB)` | Compare two QR code types |
55
+ | `random()` | Random QR code type |
56
+ | `openapi()` | OpenAPI 3.1.0 specification |
57
+
58
+ ## TypeScript Types
59
+
60
+ ```typescript
61
+ import type {
62
+ SearchResult, QRTypeDetail, VersionDetail, ComponentDetail,
63
+ EncodingDetail, StandardDetail, UseCaseDetail, GlossaryTerm, CompareResult,
64
+ } from "qrcodefyi";
65
+ ```
66
+
67
+ ## Also Available
68
+
69
+ | Language | Package |
70
+ |----------|---------|
71
+ | Python | [qrcodefyi on PyPI](https://pypi.org/project/qrcodefyi/) |
72
+ | TypeScript | **This package** |
73
+
74
+ ## Code FYI Family
75
+
76
+ Part of the [FYIPedia](https://fyipedia.com) open-source developer tools ecosystem -- automatic identification and data capture technologies.
77
+
78
+ | Package | npm | Description |
79
+ |---------|-----|-------------|
80
+ | barcodefyi | [npm](https://www.npmjs.com/package/barcodefyi) | Barcode symbologies, standards -- [barcodefyi.com](https://barcodefyi.com/) |
81
+ | **qrcodefyi** | [npm](https://www.npmjs.com/package/qrcodefyi) | **QR code types, versions, encoding -- [qrcodefyi.com](https://qrcodefyi.com/)** |
82
+ | nfcfyi | [npm](https://www.npmjs.com/package/nfcfyi) | NFC chips, NDEF, standards -- [nfcfyi.com](https://nfcfyi.com/) |
83
+ | blefyi | [npm](https://www.npmjs.com/package/blefyi) | BLE profiles, beacons, chips -- [blefyi.com](https://blefyi.com/) |
84
+ | rfidfyi | [npm](https://www.npmjs.com/package/rfidfyi) | RFID tags, readers, frequencies -- [rfidfyi.com](https://rfidfyi.com/) |
85
+ | smartcardfyi | [npm](https://www.npmjs.com/package/smartcardfyi) | Smart cards, EMV, platforms -- [smartcardfyi.com](https://smartcardfyi.com/) |
86
+
87
+ ## License
88
+
89
+ MIT
package/dist/index.cjs ADDED
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ QRCodeFYI: () => QRCodeFYI
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+
27
+ // src/client.ts
28
+ var QRCodeFYI = class {
29
+ baseUrl;
30
+ constructor(baseUrl = "https://qrcodefyi.com") {
31
+ this.baseUrl = baseUrl.replace(/\/+$/, "");
32
+ }
33
+ async get(path, params) {
34
+ const url = new URL(path, this.baseUrl);
35
+ if (params) {
36
+ Object.entries(params).forEach(([k, v]) => url.searchParams.set(k, v));
37
+ }
38
+ const res = await fetch(url.toString());
39
+ if (!res.ok) throw new Error(`HTTP ${res.status}`);
40
+ return res.json();
41
+ }
42
+ /** Search QR code types, versions, encodings, and glossary terms. */
43
+ async search(query) {
44
+ return this.get("/api/search/", { q: query });
45
+ }
46
+ /** Get a glossary term by slug. */
47
+ async glossaryTerm(slug) {
48
+ return this.get(`/api/term/${slug}/`);
49
+ }
50
+ /** Get QR code type detail by slug. */
51
+ async qrType(slug) {
52
+ return this.get(`/api/type/${slug}/`);
53
+ }
54
+ /** Get QR code version detail by version number. */
55
+ async version(version) {
56
+ return this.get(`/api/version/${version}/`);
57
+ }
58
+ /** Get QR code component detail by slug. */
59
+ async component(slug) {
60
+ return this.get(`/api/component/${slug}/`);
61
+ }
62
+ /** Get encoding mode detail by slug. */
63
+ async encoding(slug) {
64
+ return this.get(`/api/encoding/${slug}/`);
65
+ }
66
+ /** Get QR code standard detail by slug. */
67
+ async standard(slug) {
68
+ return this.get(`/api/standard/${slug}/`);
69
+ }
70
+ /** Get use case detail by slug. */
71
+ async useCase(slug) {
72
+ return this.get(`/api/use-case/${slug}/`);
73
+ }
74
+ /** Compare two QR code types. */
75
+ async compare(slugA, slugB) {
76
+ return this.get("/api/compare/", {
77
+ a: slugA,
78
+ b: slugB
79
+ });
80
+ }
81
+ /** Get a random QR code type. */
82
+ async random() {
83
+ return this.get("/api/random/");
84
+ }
85
+ /** Get the OpenAPI 3.1.0 specification. */
86
+ async openapi() {
87
+ return this.get("/api/openapi.json");
88
+ }
89
+ };
90
+ // Annotate the CommonJS export names for ESM import in node:
91
+ 0 && (module.exports = {
92
+ QRCodeFYI
93
+ });
@@ -0,0 +1,118 @@
1
+ /**
2
+ * QRCodeFYI API response types.
3
+ */
4
+ interface SearchResult {
5
+ results: Array<{
6
+ name: string;
7
+ slug: string;
8
+ type: string;
9
+ url: string;
10
+ }>;
11
+ query: string;
12
+ total: number;
13
+ }
14
+ interface GlossaryTerm {
15
+ name: string;
16
+ slug: string;
17
+ definition: string;
18
+ related_terms?: string[];
19
+ }
20
+ interface QRTypeDetail {
21
+ slug: string;
22
+ name: string;
23
+ description: string;
24
+ max_data_capacity?: string;
25
+ error_correction_levels?: string[];
26
+ url: string;
27
+ }
28
+ interface VersionDetail {
29
+ version: number;
30
+ modules: number;
31
+ description: string;
32
+ numeric_capacity?: number;
33
+ alphanumeric_capacity?: number;
34
+ byte_capacity?: number;
35
+ url: string;
36
+ }
37
+ interface ComponentDetail {
38
+ slug: string;
39
+ name: string;
40
+ description: string;
41
+ url: string;
42
+ }
43
+ interface EncodingDetail {
44
+ slug: string;
45
+ name: string;
46
+ description: string;
47
+ character_set?: string;
48
+ bits_per_character?: number;
49
+ url: string;
50
+ }
51
+ interface StandardDetail {
52
+ slug: string;
53
+ name: string;
54
+ description: string;
55
+ organization?: string;
56
+ year?: number;
57
+ url: string;
58
+ }
59
+ interface UseCaseDetail {
60
+ slug: string;
61
+ name: string;
62
+ description: string;
63
+ qr_types?: string[];
64
+ url: string;
65
+ }
66
+ interface CompareResult {
67
+ item_a: {
68
+ name: string;
69
+ slug: string;
70
+ };
71
+ item_b: {
72
+ name: string;
73
+ slug: string;
74
+ };
75
+ comparison: Record<string, unknown>;
76
+ }
77
+ interface RandomResult {
78
+ slug: string;
79
+ name: string;
80
+ type: string;
81
+ url: string;
82
+ }
83
+
84
+ /**
85
+ * QRCodeFYI API client -- TypeScript wrapper for qrcodefyi.com REST API.
86
+ *
87
+ * Zero dependencies. Uses native `fetch`.
88
+ */
89
+
90
+ declare class QRCodeFYI {
91
+ private baseUrl;
92
+ constructor(baseUrl?: string);
93
+ private get;
94
+ /** Search QR code types, versions, encodings, and glossary terms. */
95
+ search(query: string): Promise<SearchResult>;
96
+ /** Get a glossary term by slug. */
97
+ glossaryTerm(slug: string): Promise<GlossaryTerm>;
98
+ /** Get QR code type detail by slug. */
99
+ qrType(slug: string): Promise<QRTypeDetail>;
100
+ /** Get QR code version detail by version number. */
101
+ version(version: number): Promise<VersionDetail>;
102
+ /** Get QR code component detail by slug. */
103
+ component(slug: string): Promise<ComponentDetail>;
104
+ /** Get encoding mode detail by slug. */
105
+ encoding(slug: string): Promise<EncodingDetail>;
106
+ /** Get QR code standard detail by slug. */
107
+ standard(slug: string): Promise<StandardDetail>;
108
+ /** Get use case detail by slug. */
109
+ useCase(slug: string): Promise<UseCaseDetail>;
110
+ /** Compare two QR code types. */
111
+ compare(slugA: string, slugB: string): Promise<CompareResult>;
112
+ /** Get a random QR code type. */
113
+ random(): Promise<RandomResult>;
114
+ /** Get the OpenAPI 3.1.0 specification. */
115
+ openapi(): Promise<Record<string, unknown>>;
116
+ }
117
+
118
+ export { type CompareResult, type ComponentDetail, type EncodingDetail, type GlossaryTerm, QRCodeFYI, type QRTypeDetail, type RandomResult, type SearchResult, type StandardDetail, type UseCaseDetail, type VersionDetail };
@@ -0,0 +1,118 @@
1
+ /**
2
+ * QRCodeFYI API response types.
3
+ */
4
+ interface SearchResult {
5
+ results: Array<{
6
+ name: string;
7
+ slug: string;
8
+ type: string;
9
+ url: string;
10
+ }>;
11
+ query: string;
12
+ total: number;
13
+ }
14
+ interface GlossaryTerm {
15
+ name: string;
16
+ slug: string;
17
+ definition: string;
18
+ related_terms?: string[];
19
+ }
20
+ interface QRTypeDetail {
21
+ slug: string;
22
+ name: string;
23
+ description: string;
24
+ max_data_capacity?: string;
25
+ error_correction_levels?: string[];
26
+ url: string;
27
+ }
28
+ interface VersionDetail {
29
+ version: number;
30
+ modules: number;
31
+ description: string;
32
+ numeric_capacity?: number;
33
+ alphanumeric_capacity?: number;
34
+ byte_capacity?: number;
35
+ url: string;
36
+ }
37
+ interface ComponentDetail {
38
+ slug: string;
39
+ name: string;
40
+ description: string;
41
+ url: string;
42
+ }
43
+ interface EncodingDetail {
44
+ slug: string;
45
+ name: string;
46
+ description: string;
47
+ character_set?: string;
48
+ bits_per_character?: number;
49
+ url: string;
50
+ }
51
+ interface StandardDetail {
52
+ slug: string;
53
+ name: string;
54
+ description: string;
55
+ organization?: string;
56
+ year?: number;
57
+ url: string;
58
+ }
59
+ interface UseCaseDetail {
60
+ slug: string;
61
+ name: string;
62
+ description: string;
63
+ qr_types?: string[];
64
+ url: string;
65
+ }
66
+ interface CompareResult {
67
+ item_a: {
68
+ name: string;
69
+ slug: string;
70
+ };
71
+ item_b: {
72
+ name: string;
73
+ slug: string;
74
+ };
75
+ comparison: Record<string, unknown>;
76
+ }
77
+ interface RandomResult {
78
+ slug: string;
79
+ name: string;
80
+ type: string;
81
+ url: string;
82
+ }
83
+
84
+ /**
85
+ * QRCodeFYI API client -- TypeScript wrapper for qrcodefyi.com REST API.
86
+ *
87
+ * Zero dependencies. Uses native `fetch`.
88
+ */
89
+
90
+ declare class QRCodeFYI {
91
+ private baseUrl;
92
+ constructor(baseUrl?: string);
93
+ private get;
94
+ /** Search QR code types, versions, encodings, and glossary terms. */
95
+ search(query: string): Promise<SearchResult>;
96
+ /** Get a glossary term by slug. */
97
+ glossaryTerm(slug: string): Promise<GlossaryTerm>;
98
+ /** Get QR code type detail by slug. */
99
+ qrType(slug: string): Promise<QRTypeDetail>;
100
+ /** Get QR code version detail by version number. */
101
+ version(version: number): Promise<VersionDetail>;
102
+ /** Get QR code component detail by slug. */
103
+ component(slug: string): Promise<ComponentDetail>;
104
+ /** Get encoding mode detail by slug. */
105
+ encoding(slug: string): Promise<EncodingDetail>;
106
+ /** Get QR code standard detail by slug. */
107
+ standard(slug: string): Promise<StandardDetail>;
108
+ /** Get use case detail by slug. */
109
+ useCase(slug: string): Promise<UseCaseDetail>;
110
+ /** Compare two QR code types. */
111
+ compare(slugA: string, slugB: string): Promise<CompareResult>;
112
+ /** Get a random QR code type. */
113
+ random(): Promise<RandomResult>;
114
+ /** Get the OpenAPI 3.1.0 specification. */
115
+ openapi(): Promise<Record<string, unknown>>;
116
+ }
117
+
118
+ export { type CompareResult, type ComponentDetail, type EncodingDetail, type GlossaryTerm, QRCodeFYI, type QRTypeDetail, type RandomResult, type SearchResult, type StandardDetail, type UseCaseDetail, type VersionDetail };
package/dist/index.js ADDED
@@ -0,0 +1,66 @@
1
+ // src/client.ts
2
+ var QRCodeFYI = class {
3
+ baseUrl;
4
+ constructor(baseUrl = "https://qrcodefyi.com") {
5
+ this.baseUrl = baseUrl.replace(/\/+$/, "");
6
+ }
7
+ async get(path, params) {
8
+ const url = new URL(path, this.baseUrl);
9
+ if (params) {
10
+ Object.entries(params).forEach(([k, v]) => url.searchParams.set(k, v));
11
+ }
12
+ const res = await fetch(url.toString());
13
+ if (!res.ok) throw new Error(`HTTP ${res.status}`);
14
+ return res.json();
15
+ }
16
+ /** Search QR code types, versions, encodings, and glossary terms. */
17
+ async search(query) {
18
+ return this.get("/api/search/", { q: query });
19
+ }
20
+ /** Get a glossary term by slug. */
21
+ async glossaryTerm(slug) {
22
+ return this.get(`/api/term/${slug}/`);
23
+ }
24
+ /** Get QR code type detail by slug. */
25
+ async qrType(slug) {
26
+ return this.get(`/api/type/${slug}/`);
27
+ }
28
+ /** Get QR code version detail by version number. */
29
+ async version(version) {
30
+ return this.get(`/api/version/${version}/`);
31
+ }
32
+ /** Get QR code component detail by slug. */
33
+ async component(slug) {
34
+ return this.get(`/api/component/${slug}/`);
35
+ }
36
+ /** Get encoding mode detail by slug. */
37
+ async encoding(slug) {
38
+ return this.get(`/api/encoding/${slug}/`);
39
+ }
40
+ /** Get QR code standard detail by slug. */
41
+ async standard(slug) {
42
+ return this.get(`/api/standard/${slug}/`);
43
+ }
44
+ /** Get use case detail by slug. */
45
+ async useCase(slug) {
46
+ return this.get(`/api/use-case/${slug}/`);
47
+ }
48
+ /** Compare two QR code types. */
49
+ async compare(slugA, slugB) {
50
+ return this.get("/api/compare/", {
51
+ a: slugA,
52
+ b: slugB
53
+ });
54
+ }
55
+ /** Get a random QR code type. */
56
+ async random() {
57
+ return this.get("/api/random/");
58
+ }
59
+ /** Get the OpenAPI 3.1.0 specification. */
60
+ async openapi() {
61
+ return this.get("/api/openapi.json");
62
+ }
63
+ };
64
+ export {
65
+ QRCodeFYI
66
+ };
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "qrcodefyi",
3
+ "version": "0.1.0",
4
+ "description": "TypeScript API client for QRCodeFYI -- QR code types, versions, encoding modes, error correction, and standards. Zero dependencies.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "scripts": {
18
+ "build": "tsup src/index.ts --format esm --dts",
19
+ "test": "vitest run",
20
+ "typecheck": "tsc --noEmit"
21
+ },
22
+ "keywords": [
23
+ "qr-code",
24
+ "qr",
25
+ "encoding",
26
+ "error-correction",
27
+ "api-client",
28
+ "qrcodefyi"
29
+ ],
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/fyipedia/qrcodefyi-js"
33
+ },
34
+ "homepage": "https://qrcodefyi.com",
35
+ "license": "MIT",
36
+ "author": "FYIPedia",
37
+ "devDependencies": {
38
+ "tsup": "^8.0",
39
+ "typescript": "^5.7",
40
+ "vitest": "^3.0"
41
+ }
42
+ }