customizable-toast-notification 3.9.7 โ 3.10.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/dist/index.d.ts +4 -17
- package/dist/index.esm.mjs +4 -4
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/postinstall.js +4 -43
package/postinstall.js
CHANGED
|
@@ -6,28 +6,12 @@ try {
|
|
|
6
6
|
) {
|
|
7
7
|
process.exit(0);
|
|
8
8
|
} else {
|
|
9
|
-
showMessage(
|
|
9
|
+
showMessage();
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
function showMessage(
|
|
13
|
-
const width = process.stdout.columns || 80;
|
|
14
|
-
const boxWidth = 60;
|
|
15
|
-
|
|
16
|
-
const spinnerFrames = ["|", "/", "-", "\\"];
|
|
17
|
-
let i = 0;
|
|
18
|
-
|
|
19
|
-
const stripAnsi = (text) => text.replace(/\x1b\[[0-9;]*m/g, "");
|
|
20
|
-
const pad = (text) =>
|
|
21
|
-
" ".repeat(Math.max(boxWidth - stripAnsi(text).length, 0));
|
|
22
|
-
const center = (text) =>
|
|
23
|
-
" ".repeat(
|
|
24
|
-
Math.max(Math.floor((width - stripAnsi(text).length) / 2), 0)
|
|
25
|
-
) + text;
|
|
26
|
-
|
|
12
|
+
function showMessage() {
|
|
27
13
|
const lines = [
|
|
28
|
-
|
|
29
|
-
? "๐ฏThanks for sticking with it!\nThis is the final message. ๐"
|
|
30
|
-
: `๐ฆThanks for using this package!`,
|
|
14
|
+
"๐ฏThanks for sticking with it! This is the final message. ๐...๐ฆThanks for using this package!",
|
|
31
15
|
"๐ In README.md - More professional",
|
|
32
16
|
"๐จโ๐ป Author **Priyanshu Patel** -",
|
|
33
17
|
"๐ค Open to collaboration & teamwork",
|
|
@@ -36,30 +20,7 @@ try {
|
|
|
36
20
|
"๐ Built different. Stay creative.",
|
|
37
21
|
];
|
|
38
22
|
|
|
39
|
-
|
|
40
|
-
process.stdout.write(
|
|
41
|
-
`\rโณ Finalizing install ${spinnerFrames[i++ % spinnerFrames.length]} `
|
|
42
|
-
);
|
|
43
|
-
}, 100);
|
|
44
|
-
|
|
45
|
-
setTimeout(() => {
|
|
46
|
-
clearInterval(spinner);
|
|
47
|
-
process.stdout.write("\r".padEnd(40, " ") + "\r"); // Clear spinner line
|
|
48
|
-
|
|
49
|
-
console.log(
|
|
50
|
-
"\n" + center(`\x1b[36m\x1b[1mโ${"โ".repeat(boxWidth)}โ\x1b[0m`)
|
|
51
|
-
);
|
|
52
|
-
lines.forEach((line) => {
|
|
53
|
-
line.split("\n").forEach((sub) => {
|
|
54
|
-
console.log(
|
|
55
|
-
center(`\x1b[36mโ \x1b[0m${sub}${pad(sub)}\x1b[36m โ\x1b[0m`)
|
|
56
|
-
);
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
console.log(center(`\x1b[36mโ${"โ".repeat(boxWidth)}โ\x1b[0m`) + "\n");
|
|
60
|
-
|
|
61
|
-
process.exit(0); // โ
Exit only after message shown
|
|
62
|
-
}, 300);
|
|
23
|
+
console.log(lines);
|
|
63
24
|
}
|
|
64
25
|
} catch (error) {
|
|
65
26
|
process.exit(0); // Exit silently
|