This resolves #131. The previous code was already compatible with Node 7.x, but I have transitioned much of it to ES6 conventions.
I played with async/await (Node 7.6+) but did not see enough readability improvement in the dozen lines that could take advantage of async functions, especially versus losing support for Node <7.6.
Dependencies were locked down to avoid unexpected bugs stemming from third-party libraries that fail to follow semver. (This is done with shrinkwrap or the save-exact flag.) On that note, we may eventually want to think about semantic versioning for this project.
Semicolon and other style consistencies. In the future we may want to enforce pre-commit formatting via prettier.
Removed unused files (forecast-io.js local copy of the dark-sky package; and weather10kb.js which @Tardog separated into express submodules).
Added the test command as a script that can be run as npm run test (prefixed with environment API keys if not already set in ~/.bashrc). The wiki should be updated to reflect this.
Unfortunately the express logic as written is a bit brittle, so it's unwise to break it out without clear testable units. Fortunately the code is pretty small, so that's okay.
@loctn, thanks for your PR! By analyzing the history of the files in this pull request, we identified @modelm, @JulianNorton and @eliash91 to be potential reviewers.
This resolves #131. The previous code was already compatible with Node 7.x, but I have transitioned much of it to ES6 conventions.
I played with
async/await
(Node 7.6+) but did not see enough readability improvement in the dozen lines that could take advantage ofasync
functions, especially versus losing support for Node <7.6.Dependencies were locked down to avoid unexpected bugs stemming from third-party libraries that fail to follow semver. (This is done with shrinkwrap or the save-exact flag.) On that note, we may eventually want to think about semantic versioning for this project.
Semicolon and other style consistencies. In the future we may want to enforce pre-commit formatting via prettier.
Removed unused files (
forecast-io.js
local copy of thedark-sky
package; andweather10kb.js
which @Tardog separated into express submodules).Added the test command as a script that can be run as
npm run test
(prefixed with environment API keys if not already set in~/.bashrc
). The wiki should be updated to reflect this.Unfortunately the express logic as written is a bit brittle, so it's unwise to break it out without clear testable units. Fortunately the code is pretty small, so that's okay.