Skip to content

Instantly share code, notes, and snippets.

View ivankisyov's full-sized avatar
🤓
Console Logger, Level 4

Ivan Kisyov ivankisyov

🤓
Console Logger, Level 4
View GitHub Profile
@ivankisyov
ivankisyov / asyncAwait.md
Last active October 14, 2018 15:00
Async Await

Async Await {Node.js}

if a function returns a promise, you can AWAIT the result of that promise!

const axios = require("axios");

const getCountry = async countryCode => {
  try {
    const response = await axios.get(
@ivankisyov
ivankisyov / promises.md
Last active October 14, 2018 15:03
Promises

Promises

Promise.all

node.js

const axios = require("axios");

const getCountriesByRegion = region => {
@ivankisyov
ivankisyov / express.md
Last active October 12, 2018 06:51
Express

Express [Node.js]

Handling errors

// 404
app.use((req, res, next) => {
  let error = new Error("Route not found!");
  error.status = 404;
  next(error);
@ivankisyov
ivankisyov / node.md
Last active December 8, 2018 12:52
Node.js
@ivankisyov
ivankisyov / npm.md
Last active February 3, 2019 10:56
NPM

NPM

Commands

List all globally installed packages

npm list -g --depth 0

List all outdated globally installed packages

@ivankisyov
ivankisyov / git.md
Last active October 17, 2018 07:32
Git

Git

Configuration

.gitconfig

[alias]

st = status
lg = log --oneline --all --decorate --graph