eff-mnemonic 0.0.1
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/README.md +121 -0
- package/data/eff_wordlist_large.txt +7776 -0
- package/data/eff_wordlist_short_1.txt +1296 -0
- package/data/eff_wordlist_short_2_0.txt +1296 -0
- package/dist/index.cjs +88 -0
- package/dist/index.d.cts +20 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +20 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +89 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +43 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let node_fs_promises = require("node:fs/promises");
|
|
3
|
+
//#region src/base-index.ts
|
|
4
|
+
function oneToZeroBaseIndex(string) {
|
|
5
|
+
if (!/^[1-9]*$/.test(string)) throw new TypeError(`Input "${string}" contains characters other than 1-9`);
|
|
6
|
+
return string.replace(/\d/g, (d) => String(Number(d) - 1));
|
|
7
|
+
}
|
|
8
|
+
function zeroToOneBaseIndex(string) {
|
|
9
|
+
if (!/^[0-8]*$/.test(string)) throw new TypeError(`Input "${string}" contains characters other than 0-8`);
|
|
10
|
+
return string.replace(/\d/g, (d) => String(Number(d) + 1));
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/data.ts
|
|
14
|
+
const numberToWordMapByType = /* @__PURE__ */ new Map();
|
|
15
|
+
const wordToNumberMapByType = /* @__PURE__ */ new Map();
|
|
16
|
+
const getEffNumberToWordMap = async (type) => {
|
|
17
|
+
let map = numberToWordMapByType.get(type);
|
|
18
|
+
if (!map) {
|
|
19
|
+
if (type !== "large" && type !== "short_1" && type !== "short_2_0") throw new TypeError(`Invalid type "${type}"`);
|
|
20
|
+
const file = await (0, node_fs_promises.readFile)(__dirname + `/../data/eff_wordlist_${type}.txt`, "utf8");
|
|
21
|
+
map = new Map(file.split("\n").map((it) => it.split(" ")).map(([k, v]) => [oneToZeroBaseIndex(k), v]));
|
|
22
|
+
numberToWordMapByType.set(type, map);
|
|
23
|
+
}
|
|
24
|
+
return map;
|
|
25
|
+
};
|
|
26
|
+
const getEffWordToNumberMap = async (type) => {
|
|
27
|
+
let map = wordToNumberMapByType.get(type);
|
|
28
|
+
if (!map) {
|
|
29
|
+
const numberToWordMap = await getEffNumberToWordMap(type);
|
|
30
|
+
map = new Map(numberToWordMap.entries().map(([k, v]) => [v, k]));
|
|
31
|
+
wordToNumberMapByType.set(type, map);
|
|
32
|
+
}
|
|
33
|
+
return map;
|
|
34
|
+
};
|
|
35
|
+
const clearEffCache = () => {
|
|
36
|
+
numberToWordMapByType.clear();
|
|
37
|
+
wordToNumberMapByType.clear();
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/parse-big-int.ts
|
|
41
|
+
function parseBigInt(string, radix) {
|
|
42
|
+
if (radix < 2 || radix > 36) throw new TypeError("Radix must be between 2 and 36");
|
|
43
|
+
const bigRadix = BigInt(radix);
|
|
44
|
+
let result = 0n;
|
|
45
|
+
for (const char of string) {
|
|
46
|
+
const digit = parseInt(char, radix);
|
|
47
|
+
if (isNaN(digit)) throw new TypeError(`Invalid character "${char}" for radix ${radix}`);
|
|
48
|
+
result = result * bigRadix + BigInt(digit);
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/mnemonic.ts
|
|
54
|
+
async function bufferToMnemonic(buffer, type = "large") {
|
|
55
|
+
if (!buffer.length) return [];
|
|
56
|
+
const numberToWordMap = await getEffNumberToWordMap(type);
|
|
57
|
+
const base6 = BigInt("0x" + buffer.toString("hex")).toString(6);
|
|
58
|
+
const rolls = type === "large" ? 5 : 4;
|
|
59
|
+
const base6PaddedLength = Math.ceil(base6.length / rolls) * rolls;
|
|
60
|
+
return (base6.padStart(base6PaddedLength, "0").match(new RegExp(`.{1,${rolls}}`, "g")) ?? []).map((chunk) => {
|
|
61
|
+
const word = numberToWordMap.get(chunk);
|
|
62
|
+
if (!word) {
|
|
63
|
+
const sequence = zeroToOneBaseIndex(chunk);
|
|
64
|
+
throw TypeError(`Sequence "${sequence}" not in ${type} list`);
|
|
65
|
+
}
|
|
66
|
+
return word;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
async function mnemonicToBuffer(words, type = "large") {
|
|
70
|
+
if (!words.length) return Buffer.alloc(0);
|
|
71
|
+
const wordToBase6Map = await getEffWordToNumberMap(type);
|
|
72
|
+
let hex = parseBigInt(words.map((word) => {
|
|
73
|
+
const chunk = wordToBase6Map.get(word.toLowerCase());
|
|
74
|
+
if (!chunk) throw TypeError(`Word "${word}" not ${type} list`);
|
|
75
|
+
return chunk;
|
|
76
|
+
}).join(""), 6).toString(16);
|
|
77
|
+
if (hex.length % 2 !== 0) hex = "0" + hex;
|
|
78
|
+
return Buffer.from(hex, "hex");
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
exports.bufferToMnemonic = bufferToMnemonic;
|
|
82
|
+
exports.clearEffCache = clearEffCache;
|
|
83
|
+
exports.getEffNumberToWordMap = getEffNumberToWordMap;
|
|
84
|
+
exports.getEffWordToNumberMap = getEffWordToNumberMap;
|
|
85
|
+
exports.mnemonicToBuffer = mnemonicToBuffer;
|
|
86
|
+
exports.oneToZeroBaseIndex = oneToZeroBaseIndex;
|
|
87
|
+
exports.parseBigInt = parseBigInt;
|
|
88
|
+
exports.zeroToOneBaseIndex = zeroToOneBaseIndex;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/base-index.d.ts
|
|
2
|
+
declare function oneToZeroBaseIndex(string: string): string;
|
|
3
|
+
declare function zeroToOneBaseIndex(string: string): string;
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/data.d.ts
|
|
6
|
+
type EffWordListType = "large" | "short_1" | "short_2_0";
|
|
7
|
+
type EffWordMap = Map<string, string>;
|
|
8
|
+
declare const getEffNumberToWordMap: (type: EffWordListType) => Promise<EffWordMap>;
|
|
9
|
+
declare const getEffWordToNumberMap: (type: EffWordListType) => Promise<EffWordMap>;
|
|
10
|
+
declare const clearEffCache: () => void;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/mnemonic.d.ts
|
|
13
|
+
declare function bufferToMnemonic(buffer: Buffer, type?: EffWordListType): Promise<string[]>;
|
|
14
|
+
declare function mnemonicToBuffer(words: string[], type?: EffWordListType): Promise<Buffer<ArrayBuffer>>;
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/parse-big-int.d.ts
|
|
17
|
+
declare function parseBigInt(string: string, radix: number): bigint;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { EffWordListType, EffWordMap, bufferToMnemonic, clearEffCache, getEffNumberToWordMap, getEffWordToNumberMap, mnemonicToBuffer, oneToZeroBaseIndex, parseBigInt, zeroToOneBaseIndex };
|
|
20
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/base-index.ts","../src/data.ts","../src/mnemonic.ts","../src/parse-big-int.ts"],"mappings":";iBAAgB,mBAAmB;iBAQnB,mBAAmB;;;KCFvB;KACA,aAAa;cAEZ,wBAAqB,MAAgB,oBAAe,QAAA;cA+BpD,wBAAqB,MAAgB,oBAAe,QAAA;cAiBpD;;;iBCjDS,iBACpB,QAAQ,QACR,OAAM,kBAAyB;iBA4BX,iBACpB,iBACA,OAAM,kBAAyB,QAAA,OAAA;;;iBCxCjB,YAAY,gBAAgB"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/base-index.d.ts
|
|
2
|
+
declare function oneToZeroBaseIndex(string: string): string;
|
|
3
|
+
declare function zeroToOneBaseIndex(string: string): string;
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/data.d.ts
|
|
6
|
+
type EffWordListType = "large" | "short_1" | "short_2_0";
|
|
7
|
+
type EffWordMap = Map<string, string>;
|
|
8
|
+
declare const getEffNumberToWordMap: (type: EffWordListType) => Promise<EffWordMap>;
|
|
9
|
+
declare const getEffWordToNumberMap: (type: EffWordListType) => Promise<EffWordMap>;
|
|
10
|
+
declare const clearEffCache: () => void;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/mnemonic.d.ts
|
|
13
|
+
declare function bufferToMnemonic(buffer: Buffer, type?: EffWordListType): Promise<string[]>;
|
|
14
|
+
declare function mnemonicToBuffer(words: string[], type?: EffWordListType): Promise<Buffer<ArrayBuffer>>;
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/parse-big-int.d.ts
|
|
17
|
+
declare function parseBigInt(string: string, radix: number): bigint;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { EffWordListType, EffWordMap, bufferToMnemonic, clearEffCache, getEffNumberToWordMap, getEffWordToNumberMap, mnemonicToBuffer, oneToZeroBaseIndex, parseBigInt, zeroToOneBaseIndex };
|
|
20
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/base-index.ts","../src/data.ts","../src/mnemonic.ts","../src/parse-big-int.ts"],"mappings":";iBAAgB,mBAAmB;iBAQnB,mBAAmB;;;KCFvB;KACA,aAAa;cAEZ,wBAAqB,MAAgB,oBAAe,QAAA;cA+BpD,wBAAqB,MAAgB,oBAAe,QAAA;cAiBpD;;;iBCjDS,iBACpB,QAAQ,QACR,OAAM,kBAAyB;iBA4BX,iBACpB,iBACA,OAAM,kBAAyB,QAAA,OAAA;;;iBCxCjB,YAAY,gBAAgB"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { readFile } from "node:fs/promises";
|
|
4
|
+
//#region src/base-index.ts
|
|
5
|
+
function oneToZeroBaseIndex(string) {
|
|
6
|
+
if (!/^[1-9]*$/.test(string)) throw new TypeError(`Input "${string}" contains characters other than 1-9`);
|
|
7
|
+
return string.replace(/\d/g, (d) => String(Number(d) - 1));
|
|
8
|
+
}
|
|
9
|
+
function zeroToOneBaseIndex(string) {
|
|
10
|
+
if (!/^[0-8]*$/.test(string)) throw new TypeError(`Input "${string}" contains characters other than 0-8`);
|
|
11
|
+
return string.replace(/\d/g, (d) => String(Number(d) + 1));
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region node_modules/tsdown/esm-shims.js
|
|
15
|
+
const getFilename = () => fileURLToPath(import.meta.url);
|
|
16
|
+
const getDirname = () => path.dirname(getFilename());
|
|
17
|
+
const __dirname = /* @__PURE__ */ getDirname();
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/data.ts
|
|
20
|
+
const numberToWordMapByType = /* @__PURE__ */ new Map();
|
|
21
|
+
const wordToNumberMapByType = /* @__PURE__ */ new Map();
|
|
22
|
+
const getEffNumberToWordMap = async (type) => {
|
|
23
|
+
let map = numberToWordMapByType.get(type);
|
|
24
|
+
if (!map) {
|
|
25
|
+
if (type !== "large" && type !== "short_1" && type !== "short_2_0") throw new TypeError(`Invalid type "${type}"`);
|
|
26
|
+
const file = await readFile(__dirname + `/../data/eff_wordlist_${type}.txt`, "utf8");
|
|
27
|
+
map = new Map(file.split("\n").map((it) => it.split(" ")).map(([k, v]) => [oneToZeroBaseIndex(k), v]));
|
|
28
|
+
numberToWordMapByType.set(type, map);
|
|
29
|
+
}
|
|
30
|
+
return map;
|
|
31
|
+
};
|
|
32
|
+
const getEffWordToNumberMap = async (type) => {
|
|
33
|
+
let map = wordToNumberMapByType.get(type);
|
|
34
|
+
if (!map) {
|
|
35
|
+
const numberToWordMap = await getEffNumberToWordMap(type);
|
|
36
|
+
map = new Map(numberToWordMap.entries().map(([k, v]) => [v, k]));
|
|
37
|
+
wordToNumberMapByType.set(type, map);
|
|
38
|
+
}
|
|
39
|
+
return map;
|
|
40
|
+
};
|
|
41
|
+
const clearEffCache = () => {
|
|
42
|
+
numberToWordMapByType.clear();
|
|
43
|
+
wordToNumberMapByType.clear();
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/parse-big-int.ts
|
|
47
|
+
function parseBigInt(string, radix) {
|
|
48
|
+
if (radix < 2 || radix > 36) throw new TypeError("Radix must be between 2 and 36");
|
|
49
|
+
const bigRadix = BigInt(radix);
|
|
50
|
+
let result = 0n;
|
|
51
|
+
for (const char of string) {
|
|
52
|
+
const digit = parseInt(char, radix);
|
|
53
|
+
if (isNaN(digit)) throw new TypeError(`Invalid character "${char}" for radix ${radix}`);
|
|
54
|
+
result = result * bigRadix + BigInt(digit);
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/mnemonic.ts
|
|
60
|
+
async function bufferToMnemonic(buffer, type = "large") {
|
|
61
|
+
if (!buffer.length) return [];
|
|
62
|
+
const numberToWordMap = await getEffNumberToWordMap(type);
|
|
63
|
+
const base6 = BigInt("0x" + buffer.toString("hex")).toString(6);
|
|
64
|
+
const rolls = type === "large" ? 5 : 4;
|
|
65
|
+
const base6PaddedLength = Math.ceil(base6.length / rolls) * rolls;
|
|
66
|
+
return (base6.padStart(base6PaddedLength, "0").match(new RegExp(`.{1,${rolls}}`, "g")) ?? []).map((chunk) => {
|
|
67
|
+
const word = numberToWordMap.get(chunk);
|
|
68
|
+
if (!word) {
|
|
69
|
+
const sequence = zeroToOneBaseIndex(chunk);
|
|
70
|
+
throw TypeError(`Sequence "${sequence}" not in ${type} list`);
|
|
71
|
+
}
|
|
72
|
+
return word;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
async function mnemonicToBuffer(words, type = "large") {
|
|
76
|
+
if (!words.length) return Buffer.alloc(0);
|
|
77
|
+
const wordToBase6Map = await getEffWordToNumberMap(type);
|
|
78
|
+
let hex = parseBigInt(words.map((word) => {
|
|
79
|
+
const chunk = wordToBase6Map.get(word.toLowerCase());
|
|
80
|
+
if (!chunk) throw TypeError(`Word "${word}" not ${type} list`);
|
|
81
|
+
return chunk;
|
|
82
|
+
}).join(""), 6).toString(16);
|
|
83
|
+
if (hex.length % 2 !== 0) hex = "0" + hex;
|
|
84
|
+
return Buffer.from(hex, "hex");
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
export { bufferToMnemonic, clearEffCache, getEffNumberToWordMap, getEffWordToNumberMap, mnemonicToBuffer, oneToZeroBaseIndex, parseBigInt, zeroToOneBaseIndex };
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/base-index.ts","../node_modules/tsdown/esm-shims.js","../src/data.ts","../src/parse-big-int.ts","../src/mnemonic.ts"],"sourcesContent":["export function oneToZeroBaseIndex(string: string) {\n if (!/^[1-9]*$/.test(string)) {\n throw new TypeError(`Input \"${string}\" contains characters other than 1-9`);\n }\n\n return string.replace(/\\d/g, (d) => String(Number(d) - 1));\n}\n\nexport function zeroToOneBaseIndex(string: string) {\n if (!/^[0-8]*$/.test(string)) {\n throw new TypeError(`Input \"${string}\" contains characters other than 0-8`);\n }\n\n return string.replace(/\\d/g, (d) => String(Number(d) + 1));\n}\n","// Shim globals in esm bundle\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","import { readFile } from \"node:fs/promises\";\nimport { oneToZeroBaseIndex } from \"./base-index\";\n\nconst numberToWordMapByType = new Map<EffWordListType, EffWordMap>();\nconst wordToNumberMapByType = new Map<EffWordListType, EffWordMap>();\n\nexport type EffWordListType = \"large\" | \"short_1\" | \"short_2_0\";\nexport type EffWordMap = Map<string, string>;\n\nexport const getEffNumberToWordMap = async (type: EffWordListType) => {\n let map = numberToWordMapByType.get(type);\n\n // load map from file if already not loaded\n if (!map) {\n if (type !== \"large\" && type !== \"short_1\" && type !== \"short_2_0\") {\n throw new TypeError(`Invalid type \"${type}\"`);\n }\n\n const file = await readFile(\n __dirname + `/../data/eff_wordlist_${type}.txt`,\n \"utf8\",\n );\n\n // parse wordlist and build a map\n // NOTE: the dice rolls use numbers from 1 to 6, we convert this to a\n // zero based index or a base6 number\n map = new Map(\n file\n .split(\"\\n\")\n .map((it) => it.split(\"\\t\") as [string, string])\n .map(([k, v]) => [oneToZeroBaseIndex(k), v]),\n );\n\n // cache map\n numberToWordMapByType.set(type, map);\n }\n\n return map;\n};\n\nexport const getEffWordToNumberMap = async (type: EffWordListType) => {\n let map = wordToNumberMapByType.get(type);\n\n // load map from file if already not loaded\n if (!map) {\n const numberToWordMap = await getEffNumberToWordMap(type);\n\n // invert number to word map\n map = new Map(numberToWordMap.entries().map(([k, v]) => [v, k]));\n\n // cache map\n wordToNumberMapByType.set(type, map);\n }\n\n return map;\n};\n\nexport const clearEffCache = () => {\n numberToWordMapByType.clear();\n wordToNumberMapByType.clear();\n};\n","export function parseBigInt(string: string, radix: number) {\n if (radix < 2 || radix > 36) {\n throw new TypeError(\"Radix must be between 2 and 36\");\n }\n\n const bigRadix = BigInt(radix);\n\n let result = 0n;\n for (const char of string) {\n const digit = parseInt(char, radix);\n\n if (isNaN(digit)) {\n throw new TypeError(`Invalid character \"${char}\" for radix ${radix}`);\n }\n\n result = result * bigRadix + BigInt(digit);\n }\n\n return result;\n}\n","import { zeroToOneBaseIndex } from \"./base-index\";\nimport {\n EffWordListType,\n getEffNumberToWordMap,\n getEffWordToNumberMap,\n} from \"./data\";\nimport { parseBigInt } from \"./parse-big-int\";\n\nexport async function bufferToMnemonic(\n buffer: Buffer,\n type: EffWordListType = \"large\",\n) {\n // handle empty input\n if (!buffer.length) {\n return [];\n }\n\n const numberToWordMap = await getEffNumberToWordMap(type);\n const bigint = BigInt(\"0x\" + buffer.toString(\"hex\"));\n const base6 = bigint.toString(6);\n\n // pad string to ensure length is a multiple of number of dice rolls\n const rolls = type === \"large\" ? 5 : 4;\n const base6PaddedLength = Math.ceil(base6.length / rolls) * rolls;\n const base6Padded = base6.padStart(base6PaddedLength, \"0\");\n\n // split base6 string into chunks and map to words\n const base6Chunks = base6Padded.match(new RegExp(`.{1,${rolls}}`, \"g\")) ?? [];\n return base6Chunks.map((chunk) => {\n const word = numberToWordMap.get(chunk);\n if (!word) {\n const sequence = zeroToOneBaseIndex(chunk);\n throw TypeError(`Sequence \"${sequence}\" not in ${type} list`);\n }\n return word;\n });\n}\n\nexport async function mnemonicToBuffer(\n words: string[],\n type: EffWordListType = \"large\",\n) {\n // handle empty input\n if (!words.length) {\n return Buffer.alloc(0);\n }\n\n const wordToBase6Map = await getEffWordToNumberMap(type);\n const base6Chunks = words.map((word) => {\n const chunk = wordToBase6Map.get(word.toLowerCase());\n if (!chunk) {\n throw TypeError(`Word \"${word}\" not ${type} list`);\n }\n return chunk;\n });\n\n const bigint = parseBigInt(base6Chunks.join(\"\"), 6);\n let hex = bigint.toString(16);\n\n // ensure hex has even length\n if (hex.length % 2 !== 0) {\n hex = \"0\" + hex;\n }\n\n return Buffer.from(hex, \"hex\");\n}\n"],"x_google_ignoreList":[1],"mappings":";;;;AAAA,SAAgB,mBAAmB,QAAgB;CACjD,IAAI,CAAC,WAAW,KAAK,MAAM,GACzB,MAAM,IAAI,UAAU,UAAU,OAAO,qCAAqC;CAG5E,OAAO,OAAO,QAAQ,QAAQ,MAAM,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;AAC3D;AAEA,SAAgB,mBAAmB,QAAgB;CACjD,IAAI,CAAC,WAAW,KAAK,MAAM,GACzB,MAAM,IAAI,UAAU,UAAU,OAAO,qCAAqC;CAG5E,OAAO,OAAO,QAAQ,QAAQ,MAAM,OA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M;CAGd,OAAO,OAAO,KAAK,KAAK,KAAK;AAC/B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "eff-mnemonic",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Convert buffers to and from a human-readable mnemonic phrase using the eff wordlists",
|
|
5
|
+
"bugs": {
|
|
6
|
+
"url": "https://github.com/aravindanve/eff-mnemonic/issues"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/aravindanve/eff-mnemonic.git"
|
|
11
|
+
},
|
|
12
|
+
"license": "ISC",
|
|
13
|
+
"author": "Aravindan Ve",
|
|
14
|
+
"type": "commonjs",
|
|
15
|
+
"main": "./dist/index.js",
|
|
16
|
+
"module": "./dist/index.mjs",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": {
|
|
21
|
+
"import": "./dist/index.d.mts",
|
|
22
|
+
"require": "./dist/index.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"import": "./dist/index.mjs",
|
|
25
|
+
"require": "./dist/index.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"data",
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"test": "node --import tsx --test src/**/*.test.ts",
|
|
34
|
+
"build": "tsdown --shims --format cjs,esm --clean --dts src/index.ts",
|
|
35
|
+
"prepublishOnly": "npm run test && npm run build"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/node": "^26.1.1",
|
|
39
|
+
"tsdown": "^0.22.5",
|
|
40
|
+
"tsx": "^4.23.0",
|
|
41
|
+
"typescript": "^7.0.2"
|
|
42
|
+
}
|
|
43
|
+
}
|