Last active
May 21, 2017 09:23
-
-
Save jimmont/c66168b355fbb297804edee83fe15e66 to your computer and use it in GitHub Desktop.
Nodejs general notes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| authoritative sources: | |
| https://github.com/nodejs/node/wiki | |
| https://nodejs.org/en/security/ | |
| https://nodejs.org/ | |
| https://nodejs.org/en/docs/ | |
| TODO (arguably) the wiki could use more material currently spread across the internet | |
| injection/input escaping: | |
| TODO what are the modules/strategies necessary for managing input that moves through the application | |
| arguments/argv: | |
| I prefer process.argv.forEach over packages, using the specific pattern --name=value | |
| this doesn't make sense for certain types of product/end-user | |
| debugging: | |
| 1) node --inspect app.js --argvname=argvvalue // see argv comment | |
| npm run debug -- --argvname=argvvalue | |
| 2) open chrome url chrome://inspect/ and click the link "Open dedicated DevTools for Node" | |
| - 2017 May (Chrome changes regularly) | |
| deployments: | |
| convention has just 3 environments | |
| NODE_ENV = development | staging | production | |
| performance: | |
| These seem to be the only straightforward points to follow, otherwise profile your code. | |
| * avoid fn.apply => prefer fn.call (or pass arguments) based on whatever is easy/clear | |
| * avoid try/catch => eg for iterators (map/filter/forEach...) use it in caller instead; | |
| * where needed I'm providing an alternate to use via a flag (in one case user needs to submit and see specifics for each) | |
| * express's layer and promises appear to trigger a deoptimization (guessing due to try/catching errors, not my work so don't really care to look further) | |
| memory usage: | |
| TODO profiling, details ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment