From a9135824dbe6aab488c961928b2fb16cbd01a2b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Cabrera?= Date: Fri, 13 Sep 2024 11:12:11 -0400 Subject: [PATCH] Add docs on JS API support --- docs/docs-using-js-api-support.md | 32 +++++++++++++++++++++++++++++++ docs/index.md | 1 + 2 files changed, 33 insertions(+) create mode 100644 docs/docs-using-js-api-support.md diff --git a/docs/docs-using-js-api-support.md b/docs/docs-using-js-api-support.md new file mode 100644 index 00000000..d8ce2685 --- /dev/null +++ b/docs/docs-using-js-api-support.md @@ -0,0 +1,32 @@ +# JavaScript API Support + +Javy by default supports all the JavaScript features and APIs provided by +QuickJS, plus partial support for additional APIs. + +This document aims to give an overview of the additional APIs provided by Javy. + +In general the ultimate goal of Javy is to provide a [WinterCG Common +API](https://common-min-api.proposal.wintercg.org/#api-index) compatible +implementation, however, currently some APIs are not fully +compliant and therefore are provided under a custom `Javy` namespace or +explicitly marked as partially supported in the table below. + +## Compatibility table + +|API|Support|Comments| +|:-:|:-:|:-:| +|`JSON`|✅| Improved performace through SIMD JSON, when using the `-J simd-json-builtins` flag| +|`TexDecoder`|🚧| Partial support, not fully compliant| +|`TextEncoder`|🚧| Partial support, not fully compliant| +|`TextEncoder`|🚧| Partial support, not fully compliant| +|`console`|🚧| Partial support, `console.log` and `console.error`| + +Javy provides a custom `Javy` naespace, which includes the following +functionality: + +* `IO`: provides `readSync` and `writeSync`, analogous to [Node's `fs` + API](https://nodejs.org/api/fs.html). + +* `JSON`: provides `fromStdin()` and `toStdout()`. Which are helpers to read or + write from and to a file descriptor when working with `JSON`. + diff --git a/docs/index.md b/docs/index.md index c004d18b..e6dbec15 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,6 +6,7 @@ * [Extending](./docs-using-extending.md) * [Exporting functions](./docs-using-exports.md) * [Invoking modules](./docs-using-invoking.md) +* [JavaScript API Support](./docs-using-js-api-support.md) ## Contributing