{"name":"@cto.af/wtf8","version":"0.0.4","keywords":["utf8","wtf8","unicode","encode","decode","stream"],"author":{"name":"Joe Hildebrand","email":"joe-github@cursive.net"},"license":"MIT","_id":"@cto.af/wtf8@0.0.4","maintainers":[{"name":"hildjj","email":"joe-github@cursive.net"}],"homepage":"https://github.com/cto-af/wtf8#readme","bugs":{"url":"https://github.com/cto-af/wtf8/issues"},"dist":{"shasum":"44b3a1c0f07e97032c712511a5a9e8c03c6ced58","tarball":"http://registry-npm.ywwl.com/@cto.af/wtf8/download/@cto.af/wtf8-0.0.4.tgz","fileCount":17,"integrity":"sha512-GbVy/i3DNrlp6klsqA7MatSERqp338xeWdMDHSGMxUKE19hC2Yk2dydLL0LtNC9Kjbb5bXbdwHHKa/mtnIRTZw==","signatures":[{"sig":"MEUCIC3z0CqQrrYBhhPLRpv0MzUxlGUQVcZKqUnDaysudCk+AiEAg2BbcnYp3y/jDk0tMjAxFSl2blKJWo9SKPBzmLQxYyQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cto.af%2fwtf8@0.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":16824,"size":5021,"noattachment":false,"key":"/@cto.af/wtf8/-/@cto.af/wtf8-0.0.4.tgz"},"main":"lib/index.js","type":"module","types":"./lib/index.d.ts","engines":{"node":">=20"},"exports":{".":{"default":"./lib/index.js"},"./decode":{"default":"./lib/decode.js"},"./encode":{"default":"./lib/encode.js"},"./decodeStream":{"default":"./lib/decodeStream.js"},"./encodeStream":{"default":"./lib/encodeStream.js"}},"gitHead":"0c21e63d5a4c89e3ce41e61f4b3b7b74637d392a","_npmUser":{"name":"hildjj","email":"joe-github@cursive.net"},"decription":"Encode and decode WTF8 like TextEncoder and TextDecoder","repository":{"url":"git+https://github.com/cto-af/wtf8.git","type":"git"},"_npmVersion":"10.9.2","description":"Encode and decode [WTF-8](https://simonsapin.github.io/wtf-8/) with a similar API to [TextEncoder](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder) and [TextDecoder](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder).","directories":{},"_nodeVersion":"22.17.1","_hasShrinkwrap":false,"packageManager":"pnpm@10.14.0","_npmOperationalInternal":{"tmp":"tmp/wtf8_0.0.4_1754167596609_0.21502913309456706","host":"s3://npm-registry-packages-npm-production"},"readme":"# @cto.af/wtf8\n\nEncode and decode [WTF-8](https://simonsapin.github.io/wtf-8/) with a similar\nAPI to\n[TextEncoder](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder)\nand\n[TextDecoder](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder).\n\nThe goal is to be able to parse and generate bytestreams that can store any\nJavaScript string, including ones that have unpaired surrogates.\n\n## Installation\n\n```sh\nnpm install @cto.af/wtf8\n```\n\n## API\n\nFull [API documentation](http://cto-af.github.io/wtf8/) is available.\n\nExample:\n\n```js\nimport {Wtf8Decoder, Wtf8Encoder} from '@cto.af/wtf8';\n\nconst bytes = new Wtf8Encoder().encode('\\ud800');\nconst string = new Wtf8Decoder().decode(bytes); // '\\ud800'\n```\n\nW3C streams are also provided: `Wtf8EncoderStream` and `Wtf8DecoderStream`.\n\n## Notes\n\nUsed a few of the tricks from the paper\n[Validating UTF-8 In Less Than One Instruction Per Byte](https://arxiv.org/pdf/2010.03090),\nbut not all of them.  Moving data in and out of WASM to be able to use SIMD\nmight be slightly faster, but since we're not merely validating but instead\nactually decoding (and generating replacement characters when fatal is false),\nstaying in JS seems good enough for the moment.\n\n---\n[![Build Status](https://github.com/cto-af/wtf8/workflows/Tests/badge.svg)](https://github.com/cto-af/wtf8/actions?query=workflow%3ATests)\n[![codecov](https://codecov.io/gh/cto-af/wtf8/branch/main/graph/badge.svg?token=N7B7YLIDM4)](https://codecov.io/gh/cto-af/wtf8)\n","publish_time":1754167596803,"_cnpm_publish_time":1754167596803,"dist-tags":{"latest":"1.0.0"}}