{"id":13591943,"url":"https://github.com/vmasto/express-babel","last_synced_at":"2025-04-04T18:09:04.129Z","repository":{"id":45004665,"uuid":"78298077","full_name":"vmasto/express-babel","owner":"vmasto","description":"Express starter kit with ES2017+ support, testing, linting, and code coverage","archived":false,"fork":false,"pushed_at":"2021-08-01T03:18:22.000Z","size":1695,"stargazers_count":615,"open_issues_count":25,"forks_count":113,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-28T17:10:02.276Z","etag":null,"topics":["appengine","babel","boilerplate","coverage","es2015","es2017","es6","eslint","express","expressjs","heroku","javascript","jest","kit","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vmasto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-07T19:07:06.000Z","updated_at":"2025-01-14T20:33:08.000Z","dependencies_parsed_at":"2022-08-04T01:30:45.093Z","dependency_job_id":null,"html_url":"https://github.com/vmasto/express-babel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmasto%2Fexpress-babel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmasto%2Fexpress-babel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmasto%2Fexpress-babel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmasto%2Fexpress-babel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vmasto","download_url":"https://codeload.github.com/vmasto/express-babel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226215,"owners_count":20904465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appengine","babel","boilerplate","coverage","es2015","es2017","es6","eslint","express","expressjs","heroku","javascript","jest","kit","nodejs"],"created_at":"2024-08-01T16:01:03.951Z","updated_at":"2025-04-04T18:09:04.111Z","avatar_url":"https://github.com/vmasto.png","language":"JavaScript","readme":"# Express.js with Babel Boilerplate\n\n[![Code Climate](https://codeclimate.com/github/vmasto/express-babel/badges/gpa.svg)](https://codeclimate.com/github/vmasto/express-babel)\n[![Dependencies Status](https://david-dm.org/vmasto/express-babel/status.svg)](https://david-dm.org/vmasto/express-babel)\n[![Dev Dependencies Status](https://david-dm.org/vmasto/express-babel/dev-status.svg)](https://david-dm.org/vmasto/express-babel)\n\nA mostly unopinionated starter project for using Babel and ES2017+ features in a Node.js server environment as well as providing linting and testing solutions. It provides the setup for compiling, linting and testing your code but doesn't make any further assumptions on how your project should be structured.\n\nIt's a small improvement over [Babel's official approach](https://github.com/babel/example-node-server) and [express-generator](https://expressjs.com/en/starter/generator.html).\n\nMake sure you read the FAQ for more details and info.\n\n### Features:\n- [Express.js](https://expressjs.com/) as the web framework.\n- ES2017+ support with [Babel](https://babeljs.io/).\n- Automatic polyfill requires based on environment with [babel-preset-env](https://github.com/babel/babel-preset-env).\n- Linting with [ESLint](http://eslint.org/).\n- Testing with [Jest](https://facebook.github.io/jest/).\n- [Quick deployment guide](DEPLOYMENT.md) for Heroku, AWS Elastic Beanstalk, and App Engine.\n\n## Getting started\n\n```sh\n# Clone the project\ngit clone git@github.com:vmasto/express-babel.git\ncd express-babel\n\n# Make it your own\nrm -rf .git \u0026\u0026 git init \u0026\u0026 npm init\n\n# Install dependencies\nnpm install\n\n# or if you're using Yarn\nyarn\n```\nThen you can begin development:\n\n```sh\n# yarn\nyarn run dev\n\n# npm\nnpm run dev\n```\n\nThis will launch a [nodemon](https://nodemon.io/) process for automatic server restarts when your code changes.\n\n### Testing\n\nTesting is powered by [Jest](https://facebook.github.io/jest/). This project also uses [supertest](https://github.com/visionmedia/supertest) for demonstrating a simple routing smoke test suite. Feel free to remove supertest entirely if you don't wish to use it.\n\nStart the test runner in watch mode with:\n\n```sh\n# yarn\nyarn test\n\n# npm\nnpm test\n```\n\nYou can also generate coverage with:\n\n```sh\n# yarn\nyarn test --coverage\n\n# npm\nnpm test -- --coverage\n```\n\n### Linting\n\nLinting is set up using [ESLint](http://eslint.org/). It uses ESLint's default [eslint:recommended](https://github.com/eslint/eslint/blob/master/conf/eslint.json) rules. Feel free to use your own rules and/or extend another popular linting config (e.g. [airbnb's](https://www.npmjs.com/package/eslint-config-airbnb) or [standard](https://github.com/feross/eslint-config-standard)).\n\nBegin linting in watch mode with:\n\n```sh\n# yarn\nyarn run lint\n\n# npm\nnpm run lint\n```\n\nTo begin linting and start the server simultaneously, edit the `package.json` like this:\n\n```\n\"dev\": \"nodemon src/index.js --exec \\\"node -r dotenv/config -r babel-register\\\" | npm run lint\"\n```\n\n### Environmental variables in development\n\nThe project uses [dotenv](https://www.npmjs.com/package/dotenv) for setting environmental variables during development. Simply copy `.env.example`, rename it to `.env` and add your env vars as you see fit. \n\nIt is **strongly** recommended **never** to check in your .env file to version control. It should only include environment-specific values such as database passwords or API keys used in development. Your production env variables should be different and be set differently depending on your hosting solution. `dotenv` is only for development.\n\n### Deployment\n\nDeployment is specific to hosting platform/provider but generally:\n\n```sh\n# yarn\nyarn run build\n\n# npm\nnpm run build\n```\n\nwill compile your `src` into `/dist`, and \n\n```sh\n# yarn\nyarn start\n\n# npm\nnpm start\n```\n\nwill run `build` (via the `prestart` hook) and start the compiled application from the `/dist` folder.\n\nThe last command is generally what most hosting providers use to start your application when deployed, so it should take care of everything.\n\nYou can find small guides for Heroku, App Engine and AWS in [the deployment](DEPLOYMENT.md) document.\n\n### Tips / Debugging\n\n- [Quick info on how to enable VSCode debugging](https://github.com/vmasto/express-babel/issues/8#issuecomment-339851018)\n- [How to lint immediately on server start](https://github.com/vmasto/express-babel/issues/6#issuecomment-330376136)\n\n## FAQ\n\n**Where is all the configuration for ESLint, Jest and Babel?**\n\nIn `package.json`. Feel free to extract them in separate respective config files if you like.\n\n**Why are you using `babel-register` instead of `babel-node`?**\n\n`babel-node` contains a small \"trap\", it loads Babel's [polyfill](https://babeljs.io/docs/usage/polyfill/) by default. This means that if you use something that needs to be polyfilled, it'll work just fine in development (because `babel-node` polyfills it automatically) but it'll break in production because it needs to be explicitely included in Babel's CLI which handles the final build.\n\nIn order to avoid such confusions, `babel-register` is a more sensible approach in keeping the development and production runtimes equal. By using [babel-preset-env](https://github.com/babel/babel-preset-env) only code that's not supported by the running environment is transpiled and any polyfills required are automatically inserted.\n\n**Should I use this?**\n\nFull disclosure: If you have to ask perhaps you should reconsider. There is some debate on whether to use Babel-transpiled code on the server or not. Personally, I think it's fine and I've found this setup to be a sensible approach in doing so. That said, I'd suggest to take anything you read online with a grain of salt and refrain from blindly using boilerplates without first investigating personally.\n\nNode is very rapidly converging with the latest ECMAScript specification, and there's mostly full native support for ES2015 and ES2016. The need to transpile on the server is way smaller nowadays, albeit the language is constantly improving and transpiling will probably always be a part of our workflow. At the time of this writing the main benefits are mainly ES6 module syntax and async/await without flags.\n\nIn any case, you can simply remove transpilation and keep everything else that this kit has to offer.\n\nIf you see anything that needs improvement feel free to open an issue for discussion!\n\nYou can also find me on twitter at [@vmasto](https://twitter.com/vmasto).\n\n## License\nMIT License. See the [LICENSE](LICENSE) file.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmasto%2Fexpress-babel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvmasto%2Fexpress-babel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmasto%2Fexpress-babel/lists"}