Skip to content

Instantly share code, notes, and snippets.

@ymkins
ymkins / README.md
Last active February 19, 2018 17:26 — forked from dominikwilkowski/README.md
Flatten javascript objects into a single-depth object with ES6

Flatten a deep javascript object into single-depth object with ES6

Call it via:

const flat = flatten( realDeepObject ),
      flatDotted = flatten( realDeepObject, '', '.' );

Test case:

@ymkins
ymkins / gist:8c76d5a6520108ea366e79eb6be2c72f
Last active April 7, 2017 09:39 — forked from OleMchls/gist:2384354
Vagrant bash autocomplete
# Autocompletion for Vagrant just put this line in your ~/.bashrc
complete -W "$(vagrant list-commands | awk 'NR>3 {print $1}')" vagrant