flightcontrolhq / superjson

Safely serialize JavaScript expressions to a superset of JSON, which includes Dates, BigInts, and more.
https://www.flightcontrol.dev?ref=superjson
MIT License
4.01k stars 87 forks source link

feat!: make SuperJSON esm-only #263

Closed Skn0tt closed 11 months ago

Skn0tt commented 11 months ago

Closes https://github.com/blitz-js/superjson/issues/260.

This PR makes SuperJSON an esm-only module. ESM is supported in all actively-supported versions of Node.js, so it's fine to make the switch.

The changes i've made are based on this guide by Axel Rauschmayer: https://2ality.com/2021/06/typescript-esm-nodejs.html.

In the process, I'm also changing the supported Node.js versions to >= 16, because Node.js v14 reached EOL earlier this year.

Skn0tt commented 11 months ago

I was intending to publish a prerelease with 04f078e, but apparently NPM took it as latest 😅

Well, let's get this published as v2!