{"_id":"@cooljapan/oxiproj","_rev":"3-114cf6ff9c62d07480b620d4e1ad0491","name":"@cooljapan/oxiproj","dist-tags":{"latest":"0.1.5"},"versions":{"0.1.3":{"name":"@cooljapan/oxiproj","version":"0.1.3","keywords":["proj","coordinate","transformation","geodesy","wasm"],"license":"Apache-2.0","_id":"@cooljapan/oxiproj@0.1.3","maintainers":[{"name":"kitasan","email":"info@kitasan.io"}],"homepage":"https://github.com/cool-japan/oxiproj#readme","bugs":{"url":"https://github.com/cool-japan/oxiproj/issues"},"dist":{"shasum":"273607c36b8db8eda0671eeac740c2ff6bf89b35","tarball":"https://registry.npmjs.org/@cooljapan/oxiproj/-/oxiproj-0.1.3.tgz","fileCount":15,"integrity":"sha512-mqVJ40s1tA0mCYKylq86YrO/Z6MsK4HTSi7YLbwtAUwL2HYl0AG1liCqc0c5wczu31p221wwHz2PK49IDZIeQw==","signatures":[{"sig":"MEUCIQDuau1NWr1x1VSDFk8zD4tuRZEGGn4P/HMUSq6uTXPBmQIgWIN1gSTX6wHjzvQyftBOt3y25pm36+PGXsL1g4jn5U8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2331811},"main":"pkg/node/oxiproj_wasm.js","types":"pkg/web/oxiproj_wasm.d.ts","module":"pkg/web/oxiproj_wasm.js","browser":"pkg/web/oxiproj_wasm.js","exports":{".":{"node":"./pkg/node/oxiproj_wasm.js","types":"./pkg/web/oxiproj_wasm.d.ts","import":"./pkg/web/oxiproj_wasm.js","browser":"./pkg/web/oxiproj_wasm.js","default":"./pkg/web/oxiproj_wasm.js"},"./package.json":"./package.json"},"gitHead":"852d571b8d835166d19c895465472d2867332512","_npmUser":{"name":"kitasan","email":"info@kitasan.io"},"repository":{"url":"git+https://github.com/cool-japan/oxiproj.git","type":"git"},"_npmVersion":"10.8.2","description":"Pure Rust PROJ 9.8.0 port — WebAssembly bindings","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/oxiproj_0.1.3_1785912135192_0.9098170479274097","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@cooljapan/oxiproj","version":"0.1.4","keywords":["proj","coordinate","transformation","geodesy","wasm"],"license":"Apache-2.0","_id":"@cooljapan/oxiproj@0.1.4","maintainers":[{"name":"kitasan","email":"info@kitasan.io"}],"homepage":"https://github.com/cool-japan/oxiproj#readme","bugs":{"url":"https://github.com/cool-japan/oxiproj/issues"},"dist":{"shasum":"08e23fabedac1085925899d498b10ba8ae0ec051","tarball":"https://registry.npmjs.org/@cooljapan/oxiproj/-/oxiproj-0.1.4.tgz","fileCount":15,"integrity":"sha512-r+3J0tNf8/YirUPiuJEHajTvPeKzbT7iKPVt1mt+xCskYdvRHo+UpDWR8LID/8wvOs79XWOyDKj2N+EvwaGSqQ==","signatures":[{"sig":"MEUCIHEO3HtZXv3iUMxWGR1chQbkOILCPiQXQ/ie6/7IpzWbAiEAnTF8s0Pg57t1/FWIzYxXmXukeCNK4uKhQgF0BdMzc9c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2329616},"main":"pkg/node/oxiproj_wasm.js","types":"pkg/web/oxiproj_wasm.d.ts","module":"pkg/web/oxiproj_wasm.js","browser":"pkg/web/oxiproj_wasm.js","exports":{".":{"node":"./pkg/node/oxiproj_wasm.js","types":"./pkg/web/oxiproj_wasm.d.ts","import":"./pkg/web/oxiproj_wasm.js","browser":"./pkg/web/oxiproj_wasm.js","default":"./pkg/web/oxiproj_wasm.js"},"./package.json":"./package.json"},"gitHead":"b22bcd0f124306ed4f40d0cb4170017af4d4931d","_npmUser":{"name":"kitasan","email":"info@kitasan.io"},"repository":{"url":"git+https://github.com/cool-japan/oxiproj.git","type":"git"},"_npmVersion":"10.8.2","description":"Pure Rust PROJ 9.8.0 port — WebAssembly bindings","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/oxiproj_0.1.4_1786978087768_0.1710306854568977","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@cooljapan/oxiproj","version":"0.1.5","description":"Pure Rust PROJ 9.8.0 port — WebAssembly bindings","main":"pkg/node/oxiproj_wasm.js","module":"pkg/web/oxiproj_wasm.js","browser":"pkg/web/oxiproj_wasm.js","types":"pkg/web/oxiproj_wasm.d.ts","sideEffects":false,"exports":{".":{"types":"./pkg/web/oxiproj_wasm.d.ts","node":"./pkg/node/oxiproj_wasm.js","browser":"./pkg/web/oxiproj_wasm.js","import":"./pkg/web/oxiproj_wasm.js","default":"./pkg/web/oxiproj_wasm.js"},"./package.json":"./package.json"},"keywords":["proj","coordinate","transformation","geodesy","wasm"],"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/cool-japan/oxiproj.git"},"_id":"@cooljapan/oxiproj@0.1.5","gitHead":"ca1857c8b9d8b44e2aa127684dea4b2bd6bd0a67","bugs":{"url":"https://github.com/cool-japan/oxiproj/issues"},"homepage":"https://github.com/cool-japan/oxiproj#readme","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-zJDh65X+XeqPcb6F5sGKrmfZ0xz3OO5qnvq/zelH9wDt7f9v/83S+hnrkK9oFtz1Vu4hgaSsK2TOfhaEWRwhKA==","shasum":"cab148265d951dc16a5517a294f54835fba7405f","tarball":"https://registry.npmjs.org/@cooljapan/oxiproj/-/oxiproj-0.1.5.tgz","fileCount":15,"unpackedSize":2431324,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIE1mU+KaoBldjJ+g00OaCj5Wd2FrqBQJ9nTuuwXDcMWGAiA6MQ6dObonVql3qFDP+GW/mUxFC93wyMxjN7/c4EC1Rg=="}]},"_npmUser":{"name":"kitasan","email":"info@kitasan.io"},"directories":{},"maintainers":[{"name":"kitasan","email":"info@kitasan.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/oxiproj_0.1.5_1787027066393_0.7760617266667005"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-05T06:42:15.030Z","modified":"2026-08-18T04:24:26.740Z","0.1.3":"2026-08-05T06:42:15.432Z","0.1.4":"2026-08-17T14:48:07.948Z","0.1.5":"2026-08-18T04:24:26.566Z"},"bugs":{"url":"https://github.com/cool-japan/oxiproj/issues"},"license":"Apache-2.0","homepage":"https://github.com/cool-japan/oxiproj#readme","keywords":["proj","coordinate","transformation","geodesy","wasm"],"repository":{"type":"git","url":"git+https://github.com/cool-japan/oxiproj.git"},"description":"Pure Rust PROJ 9.8.0 port — WebAssembly bindings","maintainers":[{"name":"kitasan","email":"info@kitasan.io"}],"readme":"# oxiproj-wasm — WebAssembly bindings for OxiProj\n\nWebAssembly bindings for [OxiProj](https://github.com/cool-japan/oxiproj), the COOLJAPAN Pure-Rust\ncartographic coordinate transformation library (a Pure-Rust port of PROJ 9.8.0).\n\nBuilt with [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen). Published to npm as\n`@cooljapan/oxiproj`, with separate browser (`web` target) and Node.js (`nodejs` target) builds.\n\n## Installation\n\n```bash\nnpm install @cooljapan/oxiproj\n```\n\n## Usage\n\n### Browser / bundler\n\nThe browser build is an ES module; call the default export once before using any binding\n(this also happens to install a `console.error`-based panic hook, see below):\n\n```javascript\nimport init, { WasmTransformer } from \"@cooljapan/oxiproj\";\n\nawait init();\nconst t = new WasmTransformer(\"EPSG:4326\", \"EPSG:3857\");\nconst [x, y] = t.transform(12.0, 55.0);\n```\n\n### Node.js\n\nThe Node.js build loads its `.wasm` synchronously — no `init()` call needed:\n\n```javascript\nconst { WasmTransformer } = require(\"@cooljapan/oxiproj\");\n\nconst t = new WasmTransformer(\"EPSG:4326\", \"EPSG:3857\");\nconst [x, y] = t.transform(12.0, 55.0);\n```\n\n## Accepted CRS specifications\n\n`WasmTransformer` and `WasmCrs` accept a CRS specification string in one of three forms:\n\n1. A **PROJ string**, e.g. `\"+proj=longlat +datum=WGS84 +no_defs +type=crs\"`.\n2. **WKT** (WKT1_GDAL or WKT2), e.g. the output of `WasmCrs.toWkt()`.\n3. One of a small, **database-free** set of well-known `AUTHORITY:CODE` identifiers (also\n   accepted as an OGC URN, e.g. `\"urn:ogc:def:crs:EPSG::4326\"`):\n   - `EPSG:4326` — WGS 84\n   - `EPSG:4979` — WGS 84 (3D)\n   - `EPSG:4978` — WGS 84 geocentric\n   - `EPSG:3857` — WGS 84 / Pseudo-Mercator (\"Web Mercator\")\n\n**The full EPSG database (~7000 codes) is not available in this build.** The `epsg` feature of\nthe underlying [`oxiproj`](https://crates.io/crates/oxiproj) facade pulls in a Tokio runtime and\na SQLite-compatible engine that materializes the bundled 9.1 MB `proj.db` under a temp\ndirectory — neither of which exists in a browser sandbox, and the SQLite engine's dependency\nchain does not currently compile for `wasm32-unknown-unknown` at all (a transitive `getrandom`/\n`chrono` requirement isn't wired up for that target). If you need an EPSG code outside the\ndatabase-free set above, resolve it to a PROJ string or WKT definition outside this crate (e.g.\nserver-side, or with a small lookup table shipped alongside your app) and pass that instead.\nPassing an unresolvable code raises an error naming the code and this limitation.\n\n## API\n\n- `new WasmTransformer(fromCrs, toCrs)` — build a transformer.\n- `.transform(x, y)`, `.transform3d(x, y, z)` — single-coordinate transforms.\n- `.transformBatch(xs, ys)` — batch transform of separate x/y arrays, fail-fast on error.\n- `.transformArray(coords, stride)` — in-place transform of an interleaved `Float64Array`\n  (`stride` 2/3/4 for XY/XYZ/XYZT); failed points become `NaN` instead of aborting the batch.\n- `.inverse()` — **consumes** the transformer and returns a new one with source/target swapped\n  (the original JS object is no longer usable afterwards).\n- `.sourceCrs` / `.targetCrs` — the resolved `WasmCrs` for each side.\n- `.operationName` / `.operationInfo` — the coordinate operation in use, as a string or as a\n  structured object (`{ name, methodName, accuracyMetres, gridsUsed, isBallpark }`).\n- `new WasmCrs(spec)` — parse a CRS directly; exposes `.name`, `.epsgCode`, `.isGeographic`,\n  `.isProjected`, `.isGeocentric`, `.isVertical`, `.isCompound`, `.isBound`,\n  `.isEastingFirst`, `.axisCount`, `.datumName`, `.toProjString()`, `.toWkt()`.\n- `setPanicHook()` — installs a `console.error`-based panic hook; called automatically on\n  module load, exposed directly for hosts whose bundler configuration skips the module's start\n  function.\n\n## Features\n\n- Runs in the browser (ES module) or Node.js (CommonJS) — no server-side PROJ required.\n- Rust panics surface as readable `console.error` messages (via\n  [`console_error_panic_hook`](https://crates.io/crates/console_error_panic_hook)), not opaque\n  `unreachable` WASM traps.\n- Pure-Rust: no C/C++ toolchain needed at runtime.\n- `#![forbid(unsafe_code)]` — all hand-authored code in this crate is safe Rust (the\n  `wasm-bindgen`-generated FFI glue is attributed to the `wasm-bindgen` crate, not this one).\n\n## Building locally\n\n```bash\nbash crates/oxiproj-wasm/wasm-pack.sh\n```\n\nBuilds both targets into `crates/oxiproj-wasm/pkg/web/` and `crates/oxiproj-wasm/pkg/node/`\n(matching the `exports` map in `package.json`).\n\n## Part of OxiProj\n\nThis crate is part of the [OxiProj workspace](https://github.com/cool-japan/oxiproj).\nSee the top-level README for architecture and crate overview.\n","readmeFilename":"README.md"}