codepath / codepath/nodejs_guides

Design Patterns

Aperta
#16 0 commenti 0 reazioni 1 assegnatario Rivendicata da @pixelknitter Vedi su GitHub
help wanted
Lingua principale
Nessun dato sulla lingua
Stelle
74
Fork
18
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

- require at top (core, package, file) then variables
- sync only during first tick => mark as `Sync`
- use promises => nodeify(), done(), `return`
- app as dependency injection
- middleware
- small modules
- export at top (single value) or bottom (multiple values)
- avoid parasitic (monkey patching the environment / runtime) code, except at app (top) level
- use js instead of JSON for configs (for comments)
- don't store state at the module level!!!! (export a constructor and store state in the instance)
- app lifecycle: require, configure, initialize, run (first tick contains: require, configure, start of initialize)

**What success looks like: Succinctness and clarity. Less is more.**
Reference Wikis: [Modules & Packages](https://github.com/codepath/nodejs_guides/wiki/Modules-&-Packages)

Open separate issues for required links to community sources if you're having trouble finding any.

_Please assign to yourself before working on this._

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.