codepath / codepath/nodejs_guides

Design Patterns

Offen
#16 0 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @pixelknitter Auf GitHub ansehen
help wanted
Vorherrschende Sprache
Keine Sprachdaten
Sterne
74
Forks
18
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

- 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._

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.