Get started quick building and deploying a full Node.js application quick and painlessly on AWS Lambda
✓ Author in ES2017 (including the unit tests)
✓ Export as ES5 & UMD
✓ Mocha-Chai-Sinon testing stack
Write your code in src/handlers
.
Run npm run build
to compile the source into ES5.
Put your unit tests in test
. The npm test
command runs the tests using Node.
npm start
- run development web server with api (default port 3000)npm test
- Lint the library and tests, then run the unit tests and generate coverage reportsnpm run watch
- Continuously run the unit tests as you make changes to the source and test files themselvesnpm run lint
- Lint the source and testsnpm run build
- Transpile the library to ES5 in distnpm run bundle
- Build and generate distributable bundle.zip in project root
This boilerplate uses ESLint to lint your source. To
change the rules, edit the .eslintrc
files in the root directory, respectively.
Given that your unit tests typically follow different rules from your library
code, it makes sense to lint them against a separate ESLint configuration. For
this reason, a separate, unit-test specific .eslintrc
can be found in the
test
directory.
**What Babel features are supported?**
Nearly all Babel features should be supported by this boilerplate.
If you're using certain experimental features, like class properties, async-await, types, or decorators, then you'll need to install babel-eslint to use as the parser for ESLint.
If you're still getting an error, follow these steps:
- Double check to make sure that you're not typoing the new syntax ;)
- Determine what task is failing (for instance, is it ESLint?)
- Check that project's issue tracker to see if it is a known issue
- If it isn't, then open an issue here
Because of the fact that dependencies of this boilerplate, such as ESLint, are maintained by a team separate from Babel, there may be a delay between when a new feature is added to Babel and when those other libraries add support for it.
**What's the cost of transpiling?**
A thorough analysis of this question can be found here.
**How can I use this with React?**
Do you wish to use JSX? If the answer is no, then there is nothing that you need
to do. If the answer is yes, then you need to install the babel-preset-react
,
and add it to your .babelrc file.
An example .babelrc file with this preset configured can be seen here.
**How can I export my library without the "default" property?**
As stated here, https://github.com/59naga/babel-plugin-add-module-exports:
Babel@6 doesn't export default module.exports any more So just
npm install babel-plugin-add-module-exports --save-dev
and then add it to your .babelrc file:
{
"presets": [ "latest" ],
"plugins": [
"add-module-exports",
"transform-es2015-modules-umd"
]
}