node v10 has a good set of new features, the below are few of them that I liked.

FS promisified:

fs/promises API is an experimental promisified versions of the fs functions.

1 2 3 4 5 const fsp = require ( 'fs/promises' ); const stat = async ( dir ) => fsp . stat ( dir ); stat ( "." ) . then ( console . log , console . error ) . catch ( console . error );

console.table:

1 2 3 4 5 6 7 console . table ([{ a : 1 , b : 'Y' }, { a : 'Z' , b : 2 }]); // ┌─────────┬─────┬─────┐ // │ (index) │ a │ b │ // ├─────────┼─────┼─────┤ // │ 0 │ 1 │ 'Y' │ // │ 1 │ 'Z' │ 2 │ // └─────────┴─────┴─────┘

top level await in REPL:

Starting the REPL with --experimental-repl-await flag with enable top level await , so you need not wrap it in an async function.

1 2 3 4 $ node -- experimental - repl - await > const fsp = require ( 'fp/promises' ); > await fsp . stat ( "." );

pipeline for streams:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 const fs = require ( 'fs' ); const zlib = require ( 'zlib' ); const pipeline = util . promisify ( stream . pipeline ); async function run () { await pipeline ( fs . createReadStream ( 'archive.tar' ), zlib . createGzip (), fs . createWriteStream ( 'archive.tar.gz' ) ); console . log ( 'Pipeline succeeded' ); } run (). catch ( console . error );

async generators:

1 2 3 4 5 6 7 8 const answer = function * gen () { yield 42 ;}; var iterator = answer (); iterator . next (). then ( step => iterator [ Symbol . asyncIterator ](); //iterator step . done ; // false step . value ; // 42 });

for-await-of-loops:

1 2 3 4 5 6 7 8 9 10 async function foo () { const Iters = [ Promise . resolve ( 'foo' ), Promise . resolve ( 'bar' ), ]; for await ( const it of Iters ) { console . log ( it ); } } foo ();

Optional catch binding:

1 2 3 4 5 6 7 8 9 function meow (){ try { throw new Error (); } catch { return true ; } return false ; }

RegExp Unicode Property Escapes:

1 ( /\p{Script=Greek}/u).test('π'); // true

util.types.is[…]:

No more type checks deps!