Javascript port for {browser, nodejs}

31 views
Skip to first unread message

Peter Johnson

unread,
Aug 29, 2024, 5:22:29 AM8/29/24
to s2geometry-io
Dear all,

I'm pleased to announce that I've successfully ported S2 to JavaScript.
The library works in all modern browsers and in Node.js without use of WASM.

You can install the library via npm:

npm install s2js

and use it either via ESM:

import { s2 } from 's2js'

or as a CommonJS module:

const { s2 } = require('s2js')

Or include it directly in your web project via a script tag:

<script type="module">
  import { s2 } from 'https://esm.sh/s2js'
</script>


Check out the interactive demo in your browser.

I encourage everyone to please try out the JavaScript version & provide feedback or report any issues.

For documentation, please refer to the GitHub repository.

Kind Regards,
Peter Johnson
Reply all
Reply to author
Forward
0 new messages