Skip to content

Commit b05e5b5

Browse files
authored
Merge pull request #23 from sibiraj-s/install-size
Drop pify
2 parents f0d18d7 + 981914d commit b05e5b5

File tree

6 files changed

+47
-855
lines changed

6 files changed

+47
-855
lines changed

.babelrc

Lines changed: 0 additions & 11 deletions
This file was deleted.

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: node_js
22
node_js:
3-
- '8'
4-
- '10'
3+
- 10
4+
- 12
5+
- 14
56
after_success:
67
npm run coverage

package.json

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,15 @@
2020
"Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)"
2121
],
2222
"dependencies": {
23-
"@babel/runtime": "^7.6.3",
2423
"dayjs": "^1.8.16",
2524
"debug": "^4.1.1",
2625
"mailparser": "^2.7.7",
2726
"nodemailer": "^6.3.1",
2827
"open": "^6.4.0",
29-
"pify": "^4.0.1",
3028
"pug": "^2.0.4",
3129
"uuid": "^3.3.3"
3230
},
3331
"devDependencies": {
34-
"@babel/cli": "^7.6.4",
35-
"@babel/core": "^7.6.4",
36-
"@babel/plugin-transform-runtime": "^7.6.2",
37-
"@babel/preset-env": "^7.6.3",
3832
"@commitlint/cli": "^8.2.0",
3933
"@commitlint/config-conventional": "^8.2.0",
4034
"auto-bind": "^2.1.1",
@@ -49,14 +43,13 @@
4943
"nyc": "^14.1.1",
5044
"remark-cli": "^7.0.0",
5145
"remark-preset-github": "^0.0.16",
52-
"rimraf": "^3.0.0",
5346
"xo": "^0.25.3"
5447
},
5548
"engines": {
56-
"node": ">=8"
49+
"node": ">=10"
5750
},
5851
"files": [
59-
"lib",
52+
"src",
6053
"template.pug"
6154
],
6255
"homepage": "https://github.com/niftylettuce/preview-email",
@@ -115,7 +108,7 @@
115108
]
116109
}
117110
},
118-
"main": "lib/index.js",
111+
"main": "src/index.js",
119112
"prettier": {
120113
"singleQuote": true,
121114
"bracketSpacing": true,
@@ -132,14 +125,11 @@
132125
},
133126
"scripts": {
134127
"ava": "cross-env NODE_ENV=test DEBUG=preview-email ava",
135-
"build": "npm run build:clean && npm run build:lib",
136-
"build:clean": "rimraf lib dist",
137-
"build:lib": "babel src --out-dir lib",
138128
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
139-
"lint": "xo && remark . -qfo && eslint lib",
129+
"lint": "xo && remark . -qfo && eslint . --ignore-path .gitignore",
140130
"nyc": "cross-env NODE_ENV=test nyc ava",
141-
"test": "npm run build && npm run lint && npm run ava",
142-
"test-coverage": "npm run build && npm run lint && npm run nyc"
131+
"test": "npm run lint && npm run ava",
132+
"test-coverage": "npm run lint && npm run nyc"
143133
},
144134
"xo": {
145135
"prettier": true,

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
const fs = require('fs');
22
const os = require('os');
33
const path = require('path');
4+
const util = require('util');
45

56
const dayjs = require('dayjs');
67
const debug = require('debug')('preview-email');
78
const nodemailer = require('nodemailer');
89
const open = require('open');
9-
const pify = require('pify');
1010
const pug = require('pug');
1111
const uuid = require('uuid');
1212
const { simpleParser } = require('mailparser');
1313

14-
const writeFile = pify(fs.writeFile);
14+
const writeFile = util.promisify(fs.writeFile);
1515

1616
const transport = nodemailer.createTransport({
1717
streamTransport: true,
@@ -20,7 +20,7 @@ const transport = nodemailer.createTransport({
2020

2121
const templateFilePath = path.join(__dirname, '..', 'template.pug');
2222

23-
const renderFilePromise = pify(pug.renderFile);
23+
const renderFilePromise = util.promisify(pug.renderFile);
2424

2525
const previewEmail = async (message, options) => {
2626
options = {

test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const path = require('path');
44
const test = require('ava');
55
const nodemailer = require('nodemailer');
66

7-
const previewEmail = require('../lib');
7+
const previewEmail = require('../src');
88

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

0 commit comments

Comments
 (0)