@wtasnorg/node-lib 0.0.10 → 0.0.11
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/changelog.txt +14 -0
- package/docs/README.md +12 -0
- package/docs/docs.json +1438 -211
- package/docs/functions/createFindDirectories.md +1 -1
- package/docs/functions/decode.md +1 -1
- package/docs/functions/decode32.md +49 -0
- package/docs/functions/decode58.md +49 -0
- package/docs/functions/decode85.md +49 -0
- package/docs/functions/encode.md +1 -1
- package/docs/functions/encode32.md +45 -0
- package/docs/functions/encode58.md +45 -0
- package/docs/functions/encode85.md +45 -0
- package/docs/functions/hello.md +1 -1
- package/docs/functions/parseUserAgent.md +1 -1
- package/docs/functions/pojo.md +1 -1
- package/docs/interfaces/FileSystemDependencies.md +3 -3
- package/docs/interfaces/FindDirectoriesOptions.md +5 -5
- package/docs/interfaces/UserAgentInfo.md +6 -6
- package/docs/type-aliases/Base32CharsetType.md +13 -0
- package/docs/type-aliases/Base58CharsetType.md +13 -0
- package/docs/type-aliases/Base64CharsetType.md +1 -1
- package/docs/type-aliases/Base85CharsetType.md +13 -0
- package/docs/variables/Base32Charset.md +16 -0
- package/docs/variables/Base58Charset.md +16 -0
- package/docs/variables/Base64Charset.md +1 -1
- package/docs/variables/Base85Charset.md +16 -0
- package/package.json +41 -1
- package/readme.txt +12 -0
- package/src/base32.d.ts +58 -0
- package/src/base32.js +143 -0
- package/src/base32.test.d.ts +2 -0
- package/src/base32.test.js +121 -0
- package/src/base32.test.ts +144 -0
- package/src/base32.ts +169 -0
- package/src/base58.d.ts +58 -0
- package/src/base58.js +155 -0
- package/src/base58.test.d.ts +2 -0
- package/src/base58.test.js +108 -0
- package/src/base58.test.ts +128 -0
- package/src/base58.ts +177 -0
- package/src/base85.d.ts +58 -0
- package/src/base85.js +173 -0
- package/src/base85.test.d.ts +2 -0
- package/src/base85.test.js +107 -0
- package/src/base85.test.ts +125 -0
- package/src/base85.ts +199 -0
- package/src/index.d.ts +8 -2
- package/src/index.js +4 -1
- package/src/index.ts +20 -2
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **createFindDirectories**(`deps`): (`root`, `options`) => `Promise`\<`string`[]\>
|
|
10
10
|
|
|
11
|
-
Defined in: [find.ts:19](https://github.com/wtasg/node-lib/blob/
|
|
11
|
+
Defined in: [find.ts:19](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/find.ts#L19)
|
|
12
12
|
|
|
13
13
|
Factory that produces an async findDirectories function with
|
|
14
14
|
injected filesystem dependencies for full testability.
|
package/docs/functions/decode.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **decode**(`input`, `charset`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [base64.ts:119](https://github.com/wtasg/node-lib/blob/
|
|
11
|
+
Defined in: [base64.ts:119](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/base64.ts#L119)
|
|
12
12
|
|
|
13
13
|
Decode a Base64 string.
|
|
14
14
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / decode32
|
|
6
|
+
|
|
7
|
+
# Function: decode32()
|
|
8
|
+
|
|
9
|
+
> **decode32**(`input`, `charset`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: [base32.ts:136](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/base32.ts#L136)
|
|
12
|
+
|
|
13
|
+
Decode a Base32 string.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### input
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
The Base32 encoded string.
|
|
22
|
+
|
|
23
|
+
### charset
|
|
24
|
+
|
|
25
|
+
The charset variant to use (default: "rfc4648").
|
|
26
|
+
|
|
27
|
+
`"rfc4648"` | `"hex"` | `"crockford"`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
The decoded string.
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { decode32 } from "./base32.js";
|
|
39
|
+
|
|
40
|
+
decode32("JBSWY3DP");
|
|
41
|
+
// => "Hello"
|
|
42
|
+
|
|
43
|
+
decode32("EHMP6SS=", "hex");
|
|
44
|
+
// => "test"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Throws
|
|
48
|
+
|
|
49
|
+
Error if the input contains invalid characters.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / decode58
|
|
6
|
+
|
|
7
|
+
# Function: decode58()
|
|
8
|
+
|
|
9
|
+
> **decode58**(`input`, `charset`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: [base58.ts:132](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/base58.ts#L132)
|
|
12
|
+
|
|
13
|
+
Decode a Base58 string.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### input
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
The Base58 encoded string.
|
|
22
|
+
|
|
23
|
+
### charset
|
|
24
|
+
|
|
25
|
+
The charset variant to use (default: "bitcoin").
|
|
26
|
+
|
|
27
|
+
`"bitcoin"` | `"flickr"` | `"ripple"`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
The decoded string.
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { decode58 } from "./base58.js";
|
|
39
|
+
|
|
40
|
+
decode58("JxF12TrwUP45BMd");
|
|
41
|
+
// => "Hello World"
|
|
42
|
+
|
|
43
|
+
decode58("jXf12sRWto45bmD", "flickr");
|
|
44
|
+
// => "Hello World"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Throws
|
|
48
|
+
|
|
49
|
+
Error if the input contains invalid characters.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / decode85
|
|
6
|
+
|
|
7
|
+
# Function: decode85()
|
|
8
|
+
|
|
9
|
+
> **decode85**(`input`, `charset`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: [base85.ts:135](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/base85.ts#L135)
|
|
12
|
+
|
|
13
|
+
Decode a Base85 string.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### input
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
The Base85 encoded string.
|
|
22
|
+
|
|
23
|
+
### charset
|
|
24
|
+
|
|
25
|
+
The charset variant to use (default: "ascii85").
|
|
26
|
+
|
|
27
|
+
`"ascii85"` | `"z85"` | `"rfc1924"`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
The decoded string.
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { decode85 } from "./base85.js";
|
|
39
|
+
|
|
40
|
+
decode85("87cURDZ");
|
|
41
|
+
// => "Hello"
|
|
42
|
+
|
|
43
|
+
decode85("wrx.P", "z85");
|
|
44
|
+
// => "test"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Throws
|
|
48
|
+
|
|
49
|
+
Error if the input contains invalid characters.
|
package/docs/functions/encode.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **encode**(`input`, `charset`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [base64.ts:79](https://github.com/wtasg/node-lib/blob/
|
|
11
|
+
Defined in: [base64.ts:79](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/base64.ts#L79)
|
|
12
12
|
|
|
13
13
|
Encode a string to Base64.
|
|
14
14
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / encode32
|
|
6
|
+
|
|
7
|
+
# Function: encode32()
|
|
8
|
+
|
|
9
|
+
> **encode32**(`input`, `charset`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: [base32.ts:81](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/base32.ts#L81)
|
|
12
|
+
|
|
13
|
+
Encode a string to Base32.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### input
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
The string to encode.
|
|
22
|
+
|
|
23
|
+
### charset
|
|
24
|
+
|
|
25
|
+
The charset variant to use (default: "rfc4648").
|
|
26
|
+
|
|
27
|
+
`"rfc4648"` | `"hex"` | `"crockford"`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
The Base32 encoded string.
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { encode32 } from "./base32.js";
|
|
39
|
+
|
|
40
|
+
encode32("Hello");
|
|
41
|
+
// => "JBSWY3DP"
|
|
42
|
+
|
|
43
|
+
encode32("test", "hex");
|
|
44
|
+
// => "EHMP6SS="
|
|
45
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / encode58
|
|
6
|
+
|
|
7
|
+
# Function: encode58()
|
|
8
|
+
|
|
9
|
+
> **encode58**(`input`, `charset`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: [base58.ts:72](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/base58.ts#L72)
|
|
12
|
+
|
|
13
|
+
Encode a string to Base58.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### input
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
The string to encode.
|
|
22
|
+
|
|
23
|
+
### charset
|
|
24
|
+
|
|
25
|
+
The charset variant to use (default: "bitcoin").
|
|
26
|
+
|
|
27
|
+
`"bitcoin"` | `"flickr"` | `"ripple"`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
The Base58 encoded string.
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { encode58 } from "./base58.js";
|
|
39
|
+
|
|
40
|
+
encode58("Hello World");
|
|
41
|
+
// => "JxF12TrwUP45BMd"
|
|
42
|
+
|
|
43
|
+
encode58("Hello World", "flickr");
|
|
44
|
+
// => "jXf12sRWto45bmD"
|
|
45
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / encode85
|
|
6
|
+
|
|
7
|
+
# Function: encode85()
|
|
8
|
+
|
|
9
|
+
> **encode85**(`input`, `charset`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: [base85.ts:73](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/base85.ts#L73)
|
|
12
|
+
|
|
13
|
+
Encode a string to Base85.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### input
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
The string to encode.
|
|
22
|
+
|
|
23
|
+
### charset
|
|
24
|
+
|
|
25
|
+
The charset variant to use (default: "ascii85").
|
|
26
|
+
|
|
27
|
+
`"ascii85"` | `"z85"` | `"rfc1924"`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
The Base85 encoded string.
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { encode85 } from "./base85.js";
|
|
39
|
+
|
|
40
|
+
encode85("Hello");
|
|
41
|
+
// => "87cURDZ"
|
|
42
|
+
|
|
43
|
+
encode85("test", "z85");
|
|
44
|
+
// => "wrx.P"
|
|
45
|
+
```
|
package/docs/functions/hello.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **hello**(`konsole?`): `Promise`\<`string`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [hello.ts:31](https://github.com/wtasg/node-lib/blob/
|
|
11
|
+
Defined in: [hello.ts:31](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/hello.ts#L31)
|
|
12
12
|
|
|
13
13
|
A sample function that should work to test if lib is installed correctly.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **parseUserAgent**(`ua`): [`UserAgentInfo`](../interfaces/UserAgentInfo.md)
|
|
10
10
|
|
|
11
|
-
Defined in: [user-agent.ts:48](https://github.com/wtasg/node-lib/blob/
|
|
11
|
+
Defined in: [user-agent.ts:48](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/user-agent.ts#L48)
|
|
12
12
|
|
|
13
13
|
Parses a user-agent string into a UserAgentInfo object.
|
|
14
14
|
|
package/docs/functions/pojo.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **pojo**\<`T`\>(`instance`): `Record`\<`string`, `unknown`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [pojo.ts:10](https://github.com/wtasg/node-lib/blob/
|
|
11
|
+
Defined in: [pojo.ts:10](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/pojo.ts#L10)
|
|
12
12
|
|
|
13
13
|
Convert a class instance into a plain JavaScript object.
|
|
14
14
|
Copies only the instance's own enumerable data properties
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: FileSystemDependencies
|
|
8
8
|
|
|
9
|
-
Defined in: [find.ts:3](https://github.com/wtasg/node-lib/blob/
|
|
9
|
+
Defined in: [find.ts:3](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/find.ts#L3)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ Defined in: [find.ts:3](https://github.com/wtasg/node-lib/blob/7baf8669b7042dca5
|
|
|
14
14
|
|
|
15
15
|
> **readdir**: (`_path`, `_opts`) => `Promise`\<`object`[]\>
|
|
16
16
|
|
|
17
|
-
Defined in: [find.ts:4](https://github.com/wtasg/node-lib/blob/
|
|
17
|
+
Defined in: [find.ts:4](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/find.ts#L4)
|
|
18
18
|
|
|
19
19
|
#### Parameters
|
|
20
20
|
|
|
@@ -38,7 +38,7 @@ Defined in: [find.ts:4](https://github.com/wtasg/node-lib/blob/7baf8669b7042dca5
|
|
|
38
38
|
|
|
39
39
|
> **stat**: (`_path`) => `Promise`\<\{ `isDirectory`: `boolean`; \}\>
|
|
40
40
|
|
|
41
|
-
Defined in: [find.ts:5](https://github.com/wtasg/node-lib/blob/
|
|
41
|
+
Defined in: [find.ts:5](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/find.ts#L5)
|
|
42
42
|
|
|
43
43
|
#### Parameters
|
|
44
44
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: FindDirectoriesOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [find.ts:8](https://github.com/wtasg/node-lib/blob/
|
|
9
|
+
Defined in: [find.ts:8](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/find.ts#L8)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ Defined in: [find.ts:8](https://github.com/wtasg/node-lib/blob/7baf8669b7042dca5
|
|
|
14
14
|
|
|
15
15
|
> `optional` **allowlist**: `string`[] \| (`_absPath`, `_name`) => `boolean`
|
|
16
16
|
|
|
17
|
-
Defined in: [find.ts:11](https://github.com/wtasg/node-lib/blob/
|
|
17
|
+
Defined in: [find.ts:11](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/find.ts#L11)
|
|
18
18
|
|
|
19
19
|
***
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ Defined in: [find.ts:11](https://github.com/wtasg/node-lib/blob/7baf8669b7042dca
|
|
|
22
22
|
|
|
23
23
|
> `optional` **blocklist**: `string`[] \| (`_absPath`, `_name`) => `boolean`
|
|
24
24
|
|
|
25
|
-
Defined in: [find.ts:12](https://github.com/wtasg/node-lib/blob/
|
|
25
|
+
Defined in: [find.ts:12](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/find.ts#L12)
|
|
26
26
|
|
|
27
27
|
***
|
|
28
28
|
|
|
@@ -30,7 +30,7 @@ Defined in: [find.ts:12](https://github.com/wtasg/node-lib/blob/7baf8669b7042dca
|
|
|
30
30
|
|
|
31
31
|
> `optional` **followSymlinks**: `boolean`
|
|
32
32
|
|
|
33
|
-
Defined in: [find.ts:10](https://github.com/wtasg/node-lib/blob/
|
|
33
|
+
Defined in: [find.ts:10](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/find.ts#L10)
|
|
34
34
|
|
|
35
35
|
***
|
|
36
36
|
|
|
@@ -38,4 +38,4 @@ Defined in: [find.ts:10](https://github.com/wtasg/node-lib/blob/7baf8669b7042dca
|
|
|
38
38
|
|
|
39
39
|
> `optional` **maxDepth**: `number`
|
|
40
40
|
|
|
41
|
-
Defined in: [find.ts:9](https://github.com/wtasg/node-lib/blob/
|
|
41
|
+
Defined in: [find.ts:9](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/find.ts#L9)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: UserAgentInfo
|
|
8
8
|
|
|
9
|
-
Defined in: [user-agent.ts:4](https://github.com/wtasg/node-lib/blob/
|
|
9
|
+
Defined in: [user-agent.ts:4](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/user-agent.ts#L4)
|
|
10
10
|
|
|
11
11
|
Information extracted from a user-agent string.
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ Information extracted from a user-agent string.
|
|
|
16
16
|
|
|
17
17
|
> **browser**: `string`
|
|
18
18
|
|
|
19
|
-
Defined in: [user-agent.ts:8](https://github.com/wtasg/node-lib/blob/
|
|
19
|
+
Defined in: [user-agent.ts:8](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/user-agent.ts#L8)
|
|
20
20
|
|
|
21
21
|
Browser name (e.g., Chrome, Firefox, Safari, Edge, Opera, Other).
|
|
22
22
|
|
|
@@ -26,7 +26,7 @@ Browser name (e.g., Chrome, Firefox, Safari, Edge, Opera, Other).
|
|
|
26
26
|
|
|
27
27
|
> **device**: `string`
|
|
28
28
|
|
|
29
|
-
Defined in: [user-agent.ts:20](https://github.com/wtasg/node-lib/blob/
|
|
29
|
+
Defined in: [user-agent.ts:20](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/user-agent.ts#L20)
|
|
30
30
|
|
|
31
31
|
Device type (e.g., Mobile, Tablet, Desktop, Other).
|
|
32
32
|
|
|
@@ -36,7 +36,7 @@ Device type (e.g., Mobile, Tablet, Desktop, Other).
|
|
|
36
36
|
|
|
37
37
|
> **engine**: `string`
|
|
38
38
|
|
|
39
|
-
Defined in: [user-agent.ts:24](https://github.com/wtasg/node-lib/blob/
|
|
39
|
+
Defined in: [user-agent.ts:24](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/user-agent.ts#L24)
|
|
40
40
|
|
|
41
41
|
Rendering engine (e.g., Blink, WebKit, Gecko, Presto, Other).
|
|
42
42
|
|
|
@@ -46,7 +46,7 @@ Rendering engine (e.g., Blink, WebKit, Gecko, Presto, Other).
|
|
|
46
46
|
|
|
47
47
|
> **os**: `string`
|
|
48
48
|
|
|
49
|
-
Defined in: [user-agent.ts:16](https://github.com/wtasg/node-lib/blob/
|
|
49
|
+
Defined in: [user-agent.ts:16](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/user-agent.ts#L16)
|
|
50
50
|
|
|
51
51
|
Operating system (e.g., Windows, macOS, Linux, iOS, Android, Other).
|
|
52
52
|
|
|
@@ -56,6 +56,6 @@ Operating system (e.g., Windows, macOS, Linux, iOS, Android, Other).
|
|
|
56
56
|
|
|
57
57
|
> **version**: `string`
|
|
58
58
|
|
|
59
|
-
Defined in: [user-agent.ts:12](https://github.com/wtasg/node-lib/blob/
|
|
59
|
+
Defined in: [user-agent.ts:12](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/user-agent.ts#L12)
|
|
60
60
|
|
|
61
61
|
Browser version (e.g., 120.0.0.0).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / Base32CharsetType
|
|
6
|
+
|
|
7
|
+
# Type Alias: Base32CharsetType
|
|
8
|
+
|
|
9
|
+
> **Base32CharsetType** = *typeof* [`Base32Charset`](../variables/Base32Charset.md)\[`number`\]
|
|
10
|
+
|
|
11
|
+
Defined in: [base32.ts:18](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/base32.ts#L18)
|
|
12
|
+
|
|
13
|
+
Base32 charset type.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / Base58CharsetType
|
|
6
|
+
|
|
7
|
+
# Type Alias: Base58CharsetType
|
|
8
|
+
|
|
9
|
+
> **Base58CharsetType** = *typeof* [`Base58Charset`](../variables/Base58Charset.md)\[`number`\]
|
|
10
|
+
|
|
11
|
+
Defined in: [base58.ts:18](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/base58.ts#L18)
|
|
12
|
+
|
|
13
|
+
Base58 charset type.
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
> **Base64CharsetType** = *typeof* [`Base64Charset`](../variables/Base64Charset.md)\[`number`\]
|
|
10
10
|
|
|
11
|
-
Defined in: [base64.ts:18](https://github.com/wtasg/node-lib/blob/
|
|
11
|
+
Defined in: [base64.ts:18](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/base64.ts#L18)
|
|
12
12
|
|
|
13
13
|
Base64 charset type.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / Base85CharsetType
|
|
6
|
+
|
|
7
|
+
# Type Alias: Base85CharsetType
|
|
8
|
+
|
|
9
|
+
> **Base85CharsetType** = *typeof* [`Base85Charset`](../variables/Base85Charset.md)\[`number`\]
|
|
10
|
+
|
|
11
|
+
Defined in: [base85.ts:18](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/base85.ts#L18)
|
|
12
|
+
|
|
13
|
+
Base85 charset type.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / Base32Charset
|
|
6
|
+
|
|
7
|
+
# Variable: Base32Charset
|
|
8
|
+
|
|
9
|
+
> `const` **Base32Charset**: readonly \[`"rfc4648"`, `"hex"`, `"crockford"`\]
|
|
10
|
+
|
|
11
|
+
Defined in: [base32.ts:13](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/base32.ts#L13)
|
|
12
|
+
|
|
13
|
+
Available Base32 charset variants.
|
|
14
|
+
- `rfc4648`: Standard RFC 4648 alphabet (A-Z, 2-7)
|
|
15
|
+
- `hex`: Extended hex alphabet (0-9, A-V)
|
|
16
|
+
- `crockford`: Douglas Crockford's alphabet (excludes I, L, O, U)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / Base58Charset
|
|
6
|
+
|
|
7
|
+
# Variable: Base58Charset
|
|
8
|
+
|
|
9
|
+
> `const` **Base58Charset**: readonly \[`"bitcoin"`, `"flickr"`, `"ripple"`\]
|
|
10
|
+
|
|
11
|
+
Defined in: [base58.ts:13](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/base58.ts#L13)
|
|
12
|
+
|
|
13
|
+
Available Base58 charset variants.
|
|
14
|
+
- `bitcoin`: Bitcoin/IPFS alphabet (default)
|
|
15
|
+
- `flickr`: Flickr short URLs (swaps case)
|
|
16
|
+
- `ripple`: Ripple addresses
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> `const` **Base64Charset**: readonly \[`"standard"`, `"urlsafe"`, `"imap"`, `"radix64"`\]
|
|
10
10
|
|
|
11
|
-
Defined in: [base64.ts:13](https://github.com/wtasg/node-lib/blob/
|
|
11
|
+
Defined in: [base64.ts:13](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/base64.ts#L13)
|
|
12
12
|
|
|
13
13
|
Available Base64 charset variants.
|
|
14
14
|
- `standard`: RFC 4648 standard alphabet (A-Z, a-z, 0-9, +, /)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[**@wtasnorg/node-lib**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@wtasnorg/node-lib](../README.md) / Base85Charset
|
|
6
|
+
|
|
7
|
+
# Variable: Base85Charset
|
|
8
|
+
|
|
9
|
+
> `const` **Base85Charset**: readonly \[`"ascii85"`, `"z85"`, `"rfc1924"`\]
|
|
10
|
+
|
|
11
|
+
Defined in: [base85.ts:13](https://github.com/wtasg/node-lib/blob/ed0a2138895c2801b9318149a6c6b3580f396289/src/base85.ts#L13)
|
|
12
|
+
|
|
13
|
+
Available Base85 charset variants.
|
|
14
|
+
- `ascii85`: Adobe Ascii85 (btoa format)
|
|
15
|
+
- `z85`: ZeroMQ Base85 (no quotes or backslash)
|
|
16
|
+
- `rfc1924`: RFC 1924 IPv6 encoding
|
package/package.json
CHANGED
|
@@ -1,8 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wtasnorg/node-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "node library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
|
+
"module": "src/index.js",
|
|
7
|
+
"types": "src/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./src/index.d.ts",
|
|
11
|
+
"import": "./src/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./base64": {
|
|
14
|
+
"types": "./src/base64.d.ts",
|
|
15
|
+
"import": "./src/base64.js"
|
|
16
|
+
},
|
|
17
|
+
"./base58": {
|
|
18
|
+
"types": "./src/base58.d.ts",
|
|
19
|
+
"import": "./src/base58.js"
|
|
20
|
+
},
|
|
21
|
+
"./base85": {
|
|
22
|
+
"types": "./src/base85.d.ts",
|
|
23
|
+
"import": "./src/base85.js"
|
|
24
|
+
},
|
|
25
|
+
"./base32": {
|
|
26
|
+
"types": "./src/base32.d.ts",
|
|
27
|
+
"import": "./src/base32.js"
|
|
28
|
+
},
|
|
29
|
+
"./find": {
|
|
30
|
+
"types": "./src/find.d.ts",
|
|
31
|
+
"import": "./src/find.js"
|
|
32
|
+
},
|
|
33
|
+
"./user-agent": {
|
|
34
|
+
"types": "./src/user-agent.d.ts",
|
|
35
|
+
"import": "./src/user-agent.js"
|
|
36
|
+
},
|
|
37
|
+
"./pojo": {
|
|
38
|
+
"types": "./src/pojo.d.ts",
|
|
39
|
+
"import": "./src/pojo.js"
|
|
40
|
+
},
|
|
41
|
+
"./hello": {
|
|
42
|
+
"types": "./src/hello.d.ts",
|
|
43
|
+
"import": "./src/hello.js"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
6
46
|
"scripts": {
|
|
7
47
|
"build": "./node_modules/.bin/tsc --project tsconfig.json",
|
|
8
48
|
"docs": "./node_modules/.bin/typedoc",
|
package/readme.txt
CHANGED
|
@@ -12,6 +12,9 @@ A library project for nodejs. #nodejs #typescript #library
|
|
|
12
12
|
3. `createFindDirectories` as a factory for finding directories; think `find path -type d`.
|
|
13
13
|
4. `parseUserAgent` for extracting information from user-agent strings.
|
|
14
14
|
5. `encode` / `decode` for Base64 encoding/decoding with charset variants (`standard`, `urlsafe`, `imap`, `radix64`).
|
|
15
|
+
6. `encode58` / `decode58` for Base58 encoding/decoding with charset variants (`bitcoin`, `flickr`, `ripple`).
|
|
16
|
+
7. `encode85` / `decode85` for Base85 encoding/decoding with charset variants (`ascii85`, `z85`, `rfc1924`).
|
|
17
|
+
8. `encode32` / `decode32` for Base32 encoding/decoding with charset variants (`rfc4648`, `hex`, `crockford`).
|
|
15
18
|
|
|
16
19
|
## Develop
|
|
17
20
|
|
|
@@ -38,6 +41,15 @@ await hello();
|
|
|
38
41
|
// "hello from @wtasnorg/node-lib"
|
|
39
42
|
```
|
|
40
43
|
|
|
44
|
+
## Tree Shaking
|
|
45
|
+
|
|
46
|
+
Import only what you need for smaller bundles:
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import { encode58 } from "@wtasnorg/node-lib/base58";
|
|
50
|
+
import { encode32 } from "@wtasnorg/node-lib/base32";
|
|
51
|
+
```
|
|
52
|
+
|
|
41
53
|
## License: MIT
|
|
42
54
|
|
|
43
55
|
[MIT License file](LICENSE)
|