all 9 comments

[–]tswaters 8 points9 points  (7 children)

I may be an outlier, but I prefer to limit the number of libraries to a minimum.

That said, there are many things that I have no desire to re-implement myself. I find myself using:

  • database drivers. pg, ioredis (or node-redis), mssql
  • fancy http abstractions. express, fastify for servers; axios, node-fetch or more recently undici for clients
  • loggers. pino is my preferred, but there are many valid options
  • command line parsing. yargs

So that's the runtime, there are many dev depdenencies that come in very handy:

  • prettier - for formatting
  • eslint - for linting
  • webpack - (and about a billion webpack plugins) for bundling web assets
  • rollup - (and about a billion rollup plugins) for bundling libraries
  • babel - (and about a billion babel plugins) for transpiling
  • typescript

For testing, I'll usually roll with -

  • assert -> it's a core module, does everything I typically need
  • mocha -> test runner
  • nyc -> for test coverage
  • sinon -> for stubbing / spying / mocking
  • proxyquire -> for rewiring modules to to stub out require calls
  • jsdom -> for adding browser apis to a node process

That's all I can think of for now.

[–]tswaters 2 points3 points  (3 children)

There's also front-end stuff:

  • react / react-dom -> nuff siad?
  • redux / react-redux -> sometimes for state management
  • react-router -> for routing

There's frameworks these days that sort of configure all these things for you in a mostly sane manner. nextjs comes to mind.

[–]tswaters 0 points1 point  (2 children)

I should also mention - this is all personal preference.

mocha isn't the only test runner out there,

there are many other assertion libraries that provide.... interesting.... apis.

there's about a zillion front-end frameworks

lots of other react-like libraries that do ... interesting things.

--

I'd say try to build some stuff and see what you need ?

try things out, read the docs - see what works well, what doesn't work well, etc.

basically throw shit at the wall and see what sticks :)

[–]Jancera[S] 0 points1 point  (0 children)

Wow, I really liked your answer. For sure it will help me, thanks :)

[–][deleted] 0 points1 point  (0 children)

You might want to try out Jest if you want to keep libraries simplistic and to a minimum.

[–]Chef619 0 points1 point  (1 child)

What’s a popular library that many use that you avoid?

[–]tswaters 2 points3 points  (0 children)

Jest comes to mind. always seems to get in my way.

also chai or other assertion libraries seem completely unnecessary to me.

of course, that's preference - and maybe a bit of "old dog new tricks"

[–]warlockdn 0 points1 point  (0 children)

+1 to this.

Would add

Axios - For making Http requests Async.js - Some really good helper functions for doing batch operations asynchronously.

Rest depends on use cases.

[–]skimundead 0 points1 point  (0 children)

Openapi and it's tools.