@dephub/base64 1.0.0 → 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 +1 -1
- package/README.md +4 -11
- package/dist/cli.js +18 -14
- package/dist/package.json.js +1 -1
- package/dist/utils/pkg.d.ts +1 -1
- package/dist/utils/pkg.js +4 -4
- package/package.json +19 -8
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
[](https://npmjs.org/package/@dephub/base64)
|
|
8
8
|
[](https://nodejs.org/)
|
|
9
|
-
[](https://nodejs.org/)
|
|
10
9
|
|
|
11
10
|
---
|
|
12
11
|
|
|
@@ -20,16 +19,10 @@
|
|
|
20
19
|
|
|
21
20
|
## Installation 💿
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
# Using pnpm
|
|
28
|
-
pnpm add @dephub/base64
|
|
29
|
-
|
|
30
|
-
# Using yarn
|
|
31
|
-
yarn add @dephub/base64
|
|
32
|
-
```
|
|
22
|
+
- npm: `npm install @dephub/base64`
|
|
23
|
+
- pnpm: `pnpm add @dephub/base64`
|
|
24
|
+
- yarn: `yarn add @dephub/base64`
|
|
25
|
+
- bun: `bun add @dephub/base64`
|
|
33
26
|
|
|
34
27
|
## Usage 📦
|
|
35
28
|
|
package/dist/cli.js
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { decode as
|
|
4
|
-
import { encode as
|
|
5
|
-
import { name as i, version as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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(
|
|
10
|
+
console.log(s(e.string));
|
|
12
11
|
});
|
|
13
|
-
|
|
14
|
-
|
|
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(
|
|
15
|
+
console.log(t(e.base64));
|
|
18
16
|
});
|
|
19
|
-
|
|
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
|
+
}
|
package/dist/package.json.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = "@dephub/base64", s = "1.0.
|
|
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
|
package/dist/utils/pkg.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const
|
|
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 {
|
|
2
|
+
const { description: e, name: i, version: n } = o ?? {};
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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.
|
|
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,26 +32,37 @@
|
|
|
32
32
|
"dist"
|
|
33
33
|
],
|
|
34
34
|
"license": "MIT",
|
|
35
|
-
"homepage": "https://github.com/
|
|
35
|
+
"homepage": "https://github.com/dephub-js/base64#readme",
|
|
36
36
|
"repository": {
|
|
37
37
|
"type": "git",
|
|
38
|
-
"url": "https://github.com/
|
|
39
|
-
"directory": "packages/base64"
|
|
38
|
+
"url": "https://github.com/dephub-js/base64.git"
|
|
40
39
|
},
|
|
41
40
|
"bugs": {
|
|
42
|
-
"url": "https://github.com/
|
|
41
|
+
"url": "https://github.com/dephub-js/base64/issues"
|
|
43
42
|
},
|
|
44
43
|
"publishConfig": {
|
|
45
44
|
"access": "public"
|
|
46
45
|
},
|
|
47
46
|
"dependencies": {
|
|
48
|
-
"@dephub/
|
|
47
|
+
"@dephub/command": "^1.0.1"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
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
|
+
"vite-plugin-dts": "^4.5.4"
|
|
49
59
|
},
|
|
50
60
|
"scripts": {
|
|
51
61
|
"release": "pnpm publish",
|
|
62
|
+
"docs": "lineo md 'src/**/*.ts' --outFile code.md --outDir temp",
|
|
52
63
|
"check-types": "tsc --noEmit --skipLibCheck",
|
|
53
|
-
"lint": "
|
|
54
|
-
"
|
|
64
|
+
"lint": "eslint . --fix --max-warnings 0",
|
|
65
|
+
"fmt": "prettier --write .",
|
|
55
66
|
"clean": "rm -rf dist",
|
|
56
67
|
"build": "vite build",
|
|
57
68
|
"dev": "vite build -w --mode development"
|