DEV Community

Костя Третяк
Костя Третяк

Posted on

nodejs authentication written in TypeScript

Please advise, which library can be used for nodejs authentication written in TypeScript? One of the most popular libraries I know is PassportJS. But it is written for Express-like application. I would like such a library to use the modern capabilities of ES2015+, such as Promise, async/await... and ideally if it is used TypeScript for its source code.

Top comments (2)

Collapse
 
gentritabazi01 profile image
Gentrit Abazi
Collapse
 
kostyatretyak profile image
Костя Третяк • Edited

Oh, man. I have more cool examples :D

typescript

11 Tips That Make You a Better Typescript Programmer

1 Think in {Set}

Type is an everyday concept to programmers, but it’s surprisingly difficult to define it succinctly. I find it helpful to use Set as a conceptual model instead.

#2 Understand declared type and narrowed type

One extremely powerful typescript feature is automatic type narrowing based on control flow. This means a variable has two types associated with it at any specific point of code location: a declaration type and a narrowed type.

#3 Use discriminated union instead of optional fields

...

Read the whole post now!