1. Transpiling
- Babel
- Standardized JS
- Leverage full JS Ecosystem
- experimental features earlier
- No type defs, annotations required
- Test, lint, great libs
- Typescript
- Superset of Javascript
- Enhanced AutoCompletion
- Safer refactoring
- Clearer intent
- Additional non-standard features like interface
- Elm
- Compiles down to JS
- Clean Syntax
- Immutable data structures
- Friendly errors
- All errors are compile-time errors
- Interops with JS
1.1. Babel for nodejs
.babelrc:
{
"presets": [
// "env",
// "react"
"latest"
]
}
Use babel-node buildScripts/startMessage
instead of node buildScripts/startMessage
so node.js can use import
new features.