Skip to content

Instantly share code, notes, and snippets.

@avimar
Last active July 1, 2017 14:13
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avimar/58effaafeeaf33940592d5f8a0fd4d8a to your computer and use it in GitHub Desktop.
Save avimar/58effaafeeaf33940592d5f8a0fd4d8a to your computer and use it in GitHub Desktop.
Node.js/Javascript Stack

Programming Environment:

node.js backend:

  • nconf: loadable, pluggable configuration
  • restify: instead of express, it's oriented for APIs
  • bunyan: for logging, built in support from restify
  • knex.js: SQL query builder/promises/pooling (but it's not an ORM)
  • PM2: deploy and clustering
  • nodemailer: sending email (e.g. via Amazon SES plugin)

Tests/dev:

  • mocha: test runner
  • supertest: API/web tests
  • should: easier/better assertions, including simple promise support
  • eslint: forget style, just try to find errors -- see my config (+ eslint-plugin-lodash-fp)

Both node.js and front-end

(but size many make it prohibitive on front-end)

  • bluebird: promises with extra features (promisify/spread/join/props/tap/map)
  • lodash/fp FP-guide: functional version of array/object manipulation
  • zxcvbn: determine password strength
  • momentjs: date manipulation

Front-end:

  • bower: for packaging/install of deps (you can just use NPM but haven't looked for a simple way)
  • riotjs: the front-end framework -- works with jquery
  • js-cookie: save cookies
  • bootstrap: basic styling
  • jquery.payment: credit card validation before submission (via stripe)
  • jquery.rest: easy/simple REST queries (tiny package)
  • sweetalert2: popups for info/prompts
  • intl-tel-input: phone inputs, with country flags
  • jQuery: still useful

NOTE: For front-end, I stay away from loading a big promise library, avoid web-pack, transpilation with babel, etc. I avoided the complexity of any build system because there seemed to be few benefits. However, that means no promises since MSIE has no promise support (you can include a polyfill however).

LICENSE: Public Domain CC0 (Public Domain) CC0 1.0 Universal https://creativecommons.org/publicdomain/zero/1.0/

//LICENSE: CC0 1.0 Universal
{
"env": {
"es6": true,
"node": true,
"mocha": true
},
"plugins": ["lodash-fp"],
"rules": {
"no-undef": 1,
"no-unused-vars": ["warn", { "varsIgnorePattern": "should" }],
"no-cond-assign": "error",
"no-shadow": "error",
"no-dupe-args": "error",
"no-unsafe-finally": "error",
"complexity": ["warn", 20],
"max-depth": ["warn", 3],
"no-use-before-define": [
"error",
"nofunc"
],
"no-lonely-if": "error",
"no-dupe-keys": "error",
"no-func-assign": "error",
"quotes": ["warn", "single", {"avoidEscape": true}],
//"lodash-fp/consistent-compose": "off",
"lodash-fp/consistent-name": ["error", "fp"],
"lodash-fp/no-argumentless-calls": "warn",
//"lodash-fp/no-chain": "error", //see https://medium.com/making-internets/why-using-chain-is-a-mistake-9bc1f80d51ba#.rv037oiec use flow()
"lodash-fp/no-extraneous-args": "error",
"lodash-fp/no-extraneous-function-wrapping": "warn",
"lodash-fp/no-extraneous-iteratee-args": "error",//YEY!! see docs here: https://github.com/lodash/lodash/wiki/FP-Guide
//"lodash-fp/no-for-each": "warn",//let's see this
"lodash-fp/no-single-composition": "error",
"lodash-fp/no-submodule-destructuring": "error",
"lodash-fp/no-unused-result": "error",
"lodash-fp/no-partial-of-curried": "error",
"lodash-fp/prefer-compact": "error",
//"lodash-fp/prefer-composition-grouping": "error", //I don't understand it
//"lodash-fp/prefer-constant": ["error", {"arrowFunctions": false}],
"lodash-fp/prefer-flat-map": "error",
"lodash-fp/prefer-get": "error",
"lodash-fp/prefer-identity": ["error", {"arrowFunctions": false}],
"lodash-fp/preferred-alias": ["error", {"overrides": ["toString"]}],
"lodash-fp/use-fp": "error"
/*"lodash/prop-shorthand": "warn", //@TODO: lodash plugin, never triggers?
"lodash/matches-prop-shorthand": "warn",
"lodash/matches-shorthand": "warn",
"lodash/prefer-includes": "warn"*/
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment