Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .babelrc

This file was deleted.

5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: node_js
node_js:
- '8'
- '10'
- 10
- 12
- 14
after_success:
npm run coverage
22 changes: 6 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,15 @@
"Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)"
],
"dependencies": {
"@babel/runtime": "^7.6.3",
"dayjs": "^1.8.16",
"debug": "^4.1.1",
"mailparser": "^2.7.7",
"nodemailer": "^6.3.1",
"open": "^6.4.0",
"pify": "^4.0.1",
"pug": "^2.0.4",
"uuid": "^3.3.3"
},
"devDependencies": {
"@babel/cli": "^7.6.4",
"@babel/core": "^7.6.4",
"@babel/plugin-transform-runtime": "^7.6.2",
"@babel/preset-env": "^7.6.3",
"@commitlint/cli": "^8.2.0",
"@commitlint/config-conventional": "^8.2.0",
"auto-bind": "^2.1.1",
Expand All @@ -49,14 +43,13 @@
"nyc": "^14.1.1",
"remark-cli": "^7.0.0",
"remark-preset-github": "^0.0.16",
"rimraf": "^3.0.0",
"xo": "^0.25.3"
},
"engines": {
"node": ">=8"
"node": ">=10"
},
"files": [
"lib",
"src",
"template.pug"
],
"homepage": "https://github.com/niftylettuce/preview-email",
Expand Down Expand Up @@ -115,7 +108,7 @@
]
}
},
"main": "lib/index.js",
"main": "src/index.js",
"prettier": {
"singleQuote": true,
"bracketSpacing": true,
Expand All @@ -132,14 +125,11 @@
},
"scripts": {
"ava": "cross-env NODE_ENV=test DEBUG=preview-email ava",
"build": "npm run build:clean && npm run build:lib",
"build:clean": "rimraf lib dist",
"build:lib": "babel src --out-dir lib",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"lint": "xo && remark . -qfo && eslint lib",
"lint": "xo && remark . -qfo && eslint . --ignore-path .gitignore",
"nyc": "cross-env NODE_ENV=test nyc ava",
"test": "npm run build && npm run lint && npm run ava",
"test-coverage": "npm run build && npm run lint && npm run nyc"
"test": "npm run lint && npm run ava",
"test-coverage": "npm run lint && npm run nyc"
},
"xo": {
"prettier": true,
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const fs = require('fs');
const os = require('os');
const path = require('path');
const util = require('util');

const dayjs = require('dayjs');
const debug = require('debug')('preview-email');
const nodemailer = require('nodemailer');
const open = require('open');
const pify = require('pify');
const pug = require('pug');
const uuid = require('uuid');
const { simpleParser } = require('mailparser');

const writeFile = pify(fs.writeFile);
const writeFile = util.promisify(fs.writeFile);

const transport = nodemailer.createTransport({
streamTransport: true,
Expand All @@ -20,7 +20,7 @@ const transport = nodemailer.createTransport({

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

const renderFilePromise = pify(pug.renderFile);
const renderFilePromise = util.promisify(pug.renderFile);

const previewEmail = async (message, options) => {
options = {
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const path = require('path');
const test = require('ava');
const nodemailer = require('nodemailer');

const previewEmail = require('../lib');
const previewEmail = require('../src');

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

Expand Down
Loading