Skip to content

Commit

Permalink
Added Node v6.4.0+ support per #247
Browse files Browse the repository at this point in the history
  • Loading branch information
niftylettuce committed Oct 22, 2017
1 parent 8bedd42 commit ba99668
Show file tree
Hide file tree
Showing 8 changed files with 422 additions and 97 deletions.
10 changes: 10 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
["env", {
"targets": {
"node": "6.4.0"
}
}]
],
"sourceMaps": "inline"
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ node_modules
coverage
.nyc_output
locales
lib
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: node_js
node_js:
- '6'
- '7'
- '8'
after_success:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ const email = new Email({

## Options

For a list of all available options and defaults [view the configuration object](index.js).
For a list of all available options and defaults [view the configuration object](src/index.js).


## Plugins
Expand All @@ -421,7 +421,7 @@ We also highly recommend to add to your default `config.locals` the following:

* The arguments you pass to the constructor have changed as well.
* Previously you'd pass `new EmailTemplate(templateDir, options)`. Now you will need to pass simply one object with a configuration as an argument to the constructor.
* If your `templateDir` path is `path.resolve('emails')` (basically `./emails` folder) then you do not need to pass it at all since it is the default per the [configuration object](https://github.com/niftylettuce/email-templates/blob/master/index.js).
* If your `templateDir` path is `path.resolve('emails')` (basically `./emails` folder) then you do not need to pass it at all since it is the default per the [configuration object](src/index.js).
* The previous value for `templateDir` can be used as such:
```diff
Expand All @@ -447,7 +447,7 @@ We also highly recommend to add to your default `config.locals` the following:
5. A new method `email.send` has been added. This allows you to create a Nodemailer transport and send an email template all at once (it calls `email.render` internally). See the [Basic](#basic) usage documentation above for an example.
6. There are new options `options.send` and `options.preview`. Both are Boolean values and configured automatically based off the environment. Take a look at the [configuration object](index.js).
6. There are new options `options.send` and `options.preview`. Both are Boolean values and configured automatically based off the environment. Take a look at the [configuration object](src/index.js).
7. If you wish to send emails in development or test environment (disabled by default), set `options.send` to `true`.
Expand Down
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com)"
],
"dependencies": {
"@ladjs/i18n": "^0.0.3",
"@ladjs/i18n": "^0.0.5",
"auto-bind": "^1.1.0",
"consolidate": "^0.14.5",
"debug": "^3.1.0",
Expand All @@ -30,10 +30,12 @@
"lodash.merge": "^4.6.0",
"lodash.omit": "^4.5.0",
"nodemailer": "^4.1.3",
"preview-email": "^0.0.3"
"preview-email": "^0.0.5"
},
"devDependencies": {
"ava": "^0.22.0",
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.6.1",
"cheerio": "^1.0.0-rc.2",
"codecov": "^2.3.0",
"cross-env": "^5.0.5",
Expand All @@ -50,7 +52,7 @@
"xo": "^0.19.0"
},
"engines": {
"node": ">=7.6.0"
"node": ">=6.4.0"
},
"homepage": "https://github.com/niftylettuce/email-templates",
"keywords": [
Expand Down Expand Up @@ -80,7 +82,7 @@
],
"*.md": ["remark . -qfo", "git add"]
},
"main": "index.js",
"main": "lib/index.js",
"remarkConfig": {
"plugins": ["preset-github"]
},
Expand All @@ -92,8 +94,10 @@
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"lint": "xo && remark . -qfo",
"precommit": "lint-staged && npm test",
"test": "npm run lint && npm run test-coverage",
"test-coverage": "cross-env NODE_ENV=test nyc ava"
"test": "npm run build && npm run lint && npm run test-coverage",
"test-coverage": "cross-env NODE_ENV=test nyc ava",
"build": "node_modules/.bin/babel src --out-dir lib",
"watch": "node_modules/.bin/babel src --watch --out-dir lib"
},
"xo": {
"extends": "prettier",
Expand Down
File renamed without changes.
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 test = require('ava');
const nodemailer = require('nodemailer');
const cheerio = require('cheerio');

const Email = require('../');
const Email = require('../lib');

const root = path.join(__dirname, 'fixtures', 'emails');

Expand Down
Loading

0 comments on commit ba99668

Please sign in to comment.