flitbit / json-ptr

A complete implementation of JSON Pointer (RFC 6901) for nodejs and modern browsers.
MIT License
93 stars 28 forks source link

Document supported Node.js versions #43

Closed kevinoid closed 2 years ago

kevinoid commented 2 years ago

It appears that json-ptr@3.0.0 requires Node.js 14 or later due to use of optional chaining. Presumably this is intentional? It would be nice if this were mentioned in the README or in the engines field in package.json.

Thanks for considering, Kevin

cerebralkungfu commented 2 years ago

Not exactly intentional, but I did update the packaging/publishing in many ways... maybe I should have known. I'm not going to require Node.js 14... that seems too restrictive so I'll change the cjs output to be compatible with more outdated versions of Node and publish an update.

kevinoid commented 2 years ago

That'd be great! At least until Node.js 12 hits EOL on 2022-04-30. Thanks @cerebralkungfu!

kevinoid commented 2 years ago

I'll change the cjs output to be compatible with more outdated versions of Node

Note that Node 12.17 and later support native ESM without --experimental-modules, so some users may try to import the ESM version from Node 12.

Not sure if it's worth supporting. (I use it, but I don't know how common that is.) Just pointing it out in case you weren't aware.

donal-tobin-sap commented 2 years ago

Not exactly intentional, but I did update the packaging/publishing in many ways... maybe I should have known. I'm not going to require Node.js 14... that seems too restrictive so I'll change the cjs output to be compatible with more outdated versions of Node and publish an update.

Is this something that you still intend to do?

devinea commented 2 years ago

@cerebralkungfu - I created a PR to fix this, let me know if anything else is required.