nodemailer 6.4.7 → 6.4.8

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/postinstall.js +33 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodemailer",
3
- "version": "6.4.7",
3
+ "version": "6.4.8",
4
4
  "description": "Easy as cake e-mail sending from your Node.js applications",
5
5
  "main": "lib/nodemailer.js",
6
6
  "scripts": {
package/postinstall.js CHANGED
@@ -5,15 +5,27 @@ const packageData = require('./package.json');
5
5
  const isEnabled = value => !!value && value !== '0' && value !== 'false';
6
6
  const canUseColor = isEnabled(process.env.npm_config_color);
7
7
 
8
- const text = `=== Nodemailer ${packageData.version} ===
9
-
8
+ const title = `=== Nodemailer ${packageData.version} ===`;
9
+ const text = `
10
10
  Thank you for using Nodemailer for your email sending needs! While Nodemailer itself is mostly meant to be a SMTP client there are other related projects in the Nodemailer project as well.
11
11
 
12
- For example:
13
12
  > IMAP API ( https://imapapi.com ) is a server application to easily access IMAP accounts via REST API
13
+ > ImapFlow ( https://imapflow.com/ ) is an async IMAP client library for Node.js
14
14
  > NodemailerApp ( https://nodemailer.com/app/ ) is a cross platform GUI app to debug emails
15
+ > Project Pending ( https://projectpending.com/ ) allows you to park your project domains
16
+ > Ethereal Email ( https://ethereal.email/ ) is an email testing service that accepts all your test emails
15
17
  `;
16
18
 
19
+ const secs = 4;
20
+
21
+ const formatCentered = (row, columns) => {
22
+ if (columns <= row.length) {
23
+ return row;
24
+ }
25
+
26
+ return ' '.repeat(Math.round(columns / 2 - row.length / 2)) + row;
27
+ };
28
+
17
29
  const formatRow = (row, columns) => {
18
30
  if (row.length <= columns) {
19
31
  return [row];
@@ -27,10 +39,12 @@ const formatRow = (row, columns) => {
27
39
  }
28
40
  let slice = row.substr(0, columns);
29
41
 
42
+ let prefix = slice.charAt(0) === '>' ? ' ' : '';
43
+
30
44
  let match = slice.match(/(\s+)[^\s]*$/);
31
45
  if (match && match.index) {
32
46
  let line = row.substr(0, match.index);
33
- row = row.substr(line.length + match[1].length);
47
+ row = prefix + row.substr(line.length + match[1].length);
34
48
  lines.push(line);
35
49
  } else {
36
50
  lines.push(row);
@@ -44,7 +58,7 @@ const wrapText = text => {
44
58
  let columns = Number(process.stdout.columns) || 80;
45
59
  columns = Math.min(columns, 80) - 1;
46
60
 
47
- return text
61
+ return (formatCentered(title, columns) + '\n' + text)
48
62
  .split('\n')
49
63
  .flatMap(row => formatRow(row, columns))
50
64
  .join('\n');
@@ -56,3 +70,17 @@ const banner = wrapText(text)
56
70
  .replace(/(https:[^\s)]+)/g, '\u001B[94m $1 \u001B[96m');
57
71
 
58
72
  console.log(canUseColor ? banner : banner.replace(/\u001B\[\d+m/g, ''));
73
+ if (canUseColor) {
74
+ process.stdout.write('\u001B[96m');
75
+ }
76
+
77
+ setInterval(() => {
78
+ process.stdout.write('.');
79
+ }, 500);
80
+
81
+ setTimeout(() => {
82
+ if (canUseColor) {
83
+ process.stdout.write('\u001B[0m\n');
84
+ }
85
+ process.exit(0);
86
+ }, secs * 1000 + 100);