@dephub/base64 1.0.1 → 1.0.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright (c) 2025 Estarlin R
3
+ Copyright (c) 2025-2026 Estarlin R
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -19,16 +19,10 @@
19
19
 
20
20
  ## Installation 💿
21
21
 
22
- ```bash
23
- # Using npm
24
- npm install @dephub/base64
25
-
26
- # Using pnpm
27
- pnpm add @dephub/base64
28
-
29
- # Using yarn
30
- yarn add @dephub/base64
31
- ```
22
+ - npm: `npm install @dephub/base64`
23
+ - pnpm: `pnpm add @dephub/base64`
24
+ - yarn: `yarn add @dephub/base64`
25
+ - bun: `bun add @dephub/base64`
32
26
 
33
27
  ## Usage 📦
34
28
 
package/dist/cli.js CHANGED
@@ -1,19 +1,23 @@
1
1
  #!/usr/bin/env node
2
- import { cli as e } from "@dephub/cli";
3
- import { decode as n } from "./core/decode.js";
4
- import { encode as r } from "./core/encode.js";
5
- import { name as i, version as s, description as a } from "./utils/pkg.js";
6
- e.name(i.split("/")[1] ?? "name").version(s).description(a);
7
- e.command("encode", "Encode string to Base64").argument("<string>", "The text string to encode into Base64 format").action(({ args: t }) => {
8
- const o = t[0];
9
- if (o.length === 0)
2
+ import { Command as r, CommandError as n } from "@dephub/command";
3
+ import { decode as t } from "./core/decode.js";
4
+ import { encode as s } from "./core/encode.js";
5
+ import { name as i, version as a, description as d } from "./utils/pkg.js";
6
+ const o = new r().name(i.split("/")[1] ?? "base64").version(a).description(d);
7
+ o.command("encode", "Encode string to Base64").argument("string", "The text string to encode into Base64 format").handler(({ args: e }) => {
8
+ if (e.string.length === 0)
10
9
  throw new Error("You must provide a string to encode.");
11
- console.log(r(o));
10
+ console.log(s(e.string));
12
11
  });
13
- e.command("decode", "Decode Base64 to string").argument("<base64>", "The Base64 string to decode back into text").action(({ args: t }) => {
14
- const o = t[0];
15
- if (o.length === 0)
12
+ o.command("decode", "Decode Base64 to string").argument("base64", "The Base64 string to decode back into text").handler(({ args: e }) => {
13
+ if (e.base64.length === 0)
16
14
  throw new Error("You must provide a Base64 string to decode.");
17
- console.log(n(o));
15
+ console.log(t(e.base64));
18
16
  });
19
- await e.run();
17
+ try {
18
+ await o.run();
19
+ } catch (e) {
20
+ throw e instanceof n && (console.error(`
21
+ Error: ${e.message}
22
+ `), o.help(), process.exit(1)), e;
23
+ }
@@ -1,4 +1,4 @@
1
- const e = "@dephub/base64", s = "1.0.1", n = "Simple Base64 encoding and decoding utilities for Node.js and browsers", o = {
1
+ const e = "@dephub/base64", s = "1.0.2", n = "Simple Base64 encoding and decoding utilities for Node.js and browsers", o = {
2
2
  name: e,
3
3
  version: s,
4
4
  description: n
@@ -1 +1 @@
1
- export declare const version: string, description: string, name: string;
1
+ export declare const description: string, name: string, version: string;
package/dist/utils/pkg.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import o from "../package.json.js";
2
- const { version: e, description: i, name: n } = o ?? {};
2
+ const { description: e, name: i, version: n } = o ?? {};
3
3
  export {
4
- i as description,
5
- n as name,
6
- e as version
4
+ e as description,
5
+ i as name,
6
+ n as version
7
7
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dephub/base64",
3
3
  "type": "module",
4
- "version": "1.0.1",
4
+ "version": "1.0.2",
5
5
  "description": "Simple Base64 encoding and decoding utilities for Node.js and browsers",
6
6
  "types": "./dist/index.d.ts",
7
7
  "main": "./dist/index.js",
@@ -32,36 +32,37 @@
32
32
  "dist"
33
33
  ],
34
34
  "license": "MIT",
35
- "homepage": "https://github.com/estarlincito/dephub-base64#readme",
35
+ "homepage": "https://github.com/dephub-js/base64#readme",
36
36
  "repository": {
37
37
  "type": "git",
38
- "url": "https://github.com/estarlincito/dephub-base64.git"
38
+ "url": "https://github.com/dephub-js/base64.git"
39
39
  },
40
40
  "bugs": {
41
- "url": "https://github.com/estarlincito/dephub-base64/issues"
41
+ "url": "https://github.com/dephub-js/base64/issues"
42
42
  },
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
46
  "dependencies": {
47
- "@dephub/cli": "^1.0.0"
47
+ "@dephub/command": "^1.0.1"
48
48
  },
49
49
  "devDependencies": {
50
- "@dephub/glob": "^1.0.0",
51
- "@dephub/lint": "^1.0.0",
52
- "@dephub/lint-ts": "^1.0.0",
53
- "@dephub/path": "^1.0.0",
54
- "@types/node": "^24.3.1",
55
- "eslint": "^9.37.0",
56
- "typescript": "^5.9.2",
57
- "vite": "^7.1.4",
50
+ "@dephub/eslint-ts": "^1.0.2",
51
+ "@dephub/glob": "^1.0.2",
52
+ "@dephub/path": "^1.0.2",
53
+ "@types/node": "^25.3.3",
54
+ "eslint": "^10.0.2",
55
+ "prettier": "^3.8.1",
56
+ "typescript": "^5.9.3",
57
+ "vite": "^7.3.1",
58
58
  "vite-plugin-dts": "^4.5.4"
59
59
  },
60
60
  "scripts": {
61
61
  "release": "pnpm publish",
62
+ "docs": "lineo md 'src/**/*.ts' --outFile code.md --outDir temp",
62
63
  "check-types": "tsc --noEmit --skipLibCheck",
63
- "lint": "lint . --max-warnings 0",
64
- "lint:fix": "lint . --fix",
64
+ "lint": "eslint . --fix --max-warnings 0",
65
+ "fmt": "prettier --write .",
65
66
  "clean": "rm -rf dist",
66
67
  "build": "vite build",
67
68
  "dev": "vite build -w --mode development"