Our great sponsors
-
ah-theyre-here-esm-nodejs
Code accompanying my talk "Aaaaaaaaaaaaaah, They’re Here! ES Modules in Node.JS"
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
NodeConf Remote 2020 - Gil Tayar - ES Modules in Node.JS - An excellent introduction to ES modules in Node.js (companion code + link to slides, my notes from this talk).
If Node.js 12.x and 14.x releases have full support for ES modules, what gives? I was wondering the same, so I asked Matteo Collina on Twitter (he's a member of the Node.js TSC). Myles Borins (also a member of the TSC) chimed in on the thread to explain the rationale behind ES modules being marked as 'Experimental' in the 12.x and 14.x release lines:
ES module support was added to Node.js in v8.5.0 (yes, really!), and released in September 2017. At that stage it was highly experimental and missing a lot of the ES module features which Node.js now supports.
Sinon does not have support for ES modules, but there is a recently re-opened GitHub issue which offers a workaround.
If you need an alternative for mocking, testdouble.js has full ES module support thanks to some excellent work by Gil Tayar.