Skip to content

Commit fcd6fe1

Browse files
committed
chore: bump deps
1 parent b05e5b5 commit fcd6fe1

File tree

5 files changed

+3826
-4100
lines changed

5 files changed

+3826
-4100
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
66
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
77
[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)
8-
[![license](https://img.shields.io/github/license/niftylettuce/preview-email.svg)](<>)
8+
[![license](https://img.shields.io/github/license/niftylettuce/preview-email.svg)]()
99

1010
> Automatically opens your browser to preview [Node.js][node] email messages sent with [Nodemailer][]. Made for [Lad][]!
1111
@@ -108,7 +108,7 @@ DEBUG=preview-email node app.js
108108
* `dir` (String) - a path to a directory for saving the generated email previews (defaults to `os.tmpdir()`, see [os docs](https://nodejs.org/api/os.html#os_os_tmpdir) for more insight)
109109
* `open` (Object or Boolean) - an options object that is passed to [open][] (defaults to `{ wait: false }`) - if set to `false` then it will not open the email automaitcally in the browser using [open][], and if set to `true` then it will default to `{ wait: false }`
110110
* `template` (String) - a file path to a `pug` template file (defaults to preview-email's [template.pug](template.pug) by default) - **this is where you can pass a custom template for rendering email previews, e.g. your own stylesheet**
111-
* `urlTransform` (Function (path) => url) - a function to build preview url from file path (defaults to `(path) => 'file://[file path]'`) - _this is where you can customize the opened path to handle WSL to Windows tranformation or build a http url if `dir` is served._
111+
* `urlTransform` (Function (path) => url) - a function to build preview url from file path (defaults to `(path) => 'file://[file path]'`) - *this is where you can customize the opened path to handle WSL to Windows tranformation or build a http url if `dir` is served.*
112112

113113

114114
## Contributors
@@ -123,7 +123,7 @@ DEBUG=preview-email node app.js
123123
[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)
124124

125125

126-
##
126+
##
127127

128128
[npm]: https://www.npmjs.com/
129129

package.json

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,29 @@
2020
"Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)"
2121
],
2222
"dependencies": {
23-
"dayjs": "^1.8.16",
24-
"debug": "^4.1.1",
25-
"mailparser": "^2.7.7",
26-
"nodemailer": "^6.3.1",
27-
"open": "^6.4.0",
28-
"pug": "^2.0.4",
29-
"uuid": "^3.3.3"
23+
"dayjs": "^1.9.6",
24+
"debug": "^4.3.1",
25+
"mailparser": "^3.0.0",
26+
"nodemailer": "^6.4.16",
27+
"open": "^7.3.0",
28+
"pug": "^3.0.0",
29+
"uuid": "^8.3.1"
3030
},
3131
"devDependencies": {
32-
"@commitlint/cli": "^8.2.0",
33-
"@commitlint/config-conventional": "^8.2.0",
34-
"auto-bind": "^2.1.1",
35-
"ava": "^2.4.0",
36-
"codecov": "^3.6.1",
37-
"cross-env": "^6.0.3",
38-
"eslint": "^6.5.1",
39-
"eslint-config-xo-lass": "^1.0.3",
40-
"eslint-plugin-node": "^10.0.0",
41-
"husky": "^3.0.8",
42-
"lint-staged": "^9.4.2",
43-
"nyc": "^14.1.1",
44-
"remark-cli": "^7.0.0",
45-
"remark-preset-github": "^0.0.16",
46-
"xo": "^0.25.3"
32+
"@commitlint/cli": "^11.0.0",
33+
"@commitlint/config-conventional": "^11.0.0",
34+
"ava": "^3.13.0",
35+
"codecov": "^3.8.1",
36+
"cross-env": "^7.0.2",
37+
"eslint": "^7.14.0",
38+
"eslint-config-xo-lass": "^1.0.4",
39+
"eslint-plugin-node": "^11.1.0",
40+
"husky": "^4.3.0",
41+
"lint-staged": "^10.5.1",
42+
"nyc": "^15.1.0",
43+
"remark-cli": "^9.0.0",
44+
"remark-preset-github": "^3.0.4",
45+
"xo": "^0.35.0"
4746
},
4847
"engines": {
4948
"node": ">=10"

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ const previewEmail = async (message, options) => {
2828
id: uuid.v4(),
2929
open: { wait: false },
3030
template: templateFilePath,
31-
urlTransform: path => `file://${path}`,
31+
urlTransform: (path) => `file://${path}`,
3232
...options
3333
};
3434
debug('message', message, 'options', options);
3535

3636
if (typeof message !== 'object')
3737
throw new Error('Message argument is required');
3838

39-
const res = await transport.sendMail(message);
39+
const response = await transport.sendMail(message);
4040

41-
const parsed = await simpleParser(res.message);
41+
const parsed = await simpleParser(response.message);
4242

4343
const html = await renderFilePromise(
4444
options.template,

test/test.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ const previewEmail = require('../src');
88

99
const transport = nodemailer.createTransport({ jsonTransport: true });
1010

11-
test('returns function', t => {
11+
test('returns function', (t) => {
1212
t.true(typeof previewEmail === 'function');
1313
});
1414

15-
test('opens a preview email', async t => {
15+
test('opens a preview email', async (t) => {
1616
const message = {
1717
from: 'niftylettuce <niftylettuce+from@gmail.com>',
1818
to: 'niftylettuce+to@gmail.com, niftylettuce <niftylettuce+test@gmail.com>',
@@ -37,38 +37,38 @@ test('opens a preview email', async t => {
3737
unsubscribe: 'https://niftylettuce.com/unsubscribe'
3838
}
3939
};
40-
const res = await transport.sendMail(message);
41-
const url = await previewEmail(JSON.parse(res.message));
40+
const response = await transport.sendMail(message);
41+
const url = await previewEmail(JSON.parse(response.message));
4242
t.true(typeof url === 'string');
4343
});
4444

45-
test('does not open', async t => {
45+
test('does not open', async (t) => {
4646
const url = await previewEmail({}, { open: false });
4747
t.true(typeof url === 'string');
4848
});
4949

50-
test('invalid message', async t => {
50+
test('invalid message', async (t) => {
5151
const error = await t.throwsAsync(previewEmail(false));
5252
t.is(error.message, 'Message argument is required');
5353
});
5454

55-
test('custom id', async t => {
55+
test('custom id', async (t) => {
5656
const id = new Date().getTime().toString();
5757
const url = await previewEmail({}, { id, open: false });
5858
t.is(path.basename(url).replace('.html', ''), id);
5959
});
6060

61-
test('does not open in browser', async t => {
61+
test('does not open in browser', async (t) => {
6262
const url = await previewEmail({}, { open: false });
6363
t.true(typeof url === 'string');
6464
});
6565

66-
test('transform URL', async t => {
66+
test('transform URL', async (t) => {
6767
const url = await previewEmail(
6868
{},
6969
{
7070
open: false,
71-
urlTransform: path => `http://localhost:8000/${path}`
71+
urlTransform: (path) => `http://localhost:8000/${path}`
7272
}
7373
);
7474
t.regex(url, /^http:\/\/localhost:8000\//);

0 commit comments

Comments
 (0)