Skip to content

Commit

Permalink
Add docs on JS API support
Browse files Browse the repository at this point in the history
  • Loading branch information
saulecabrera committed Sep 13, 2024
1 parent fca3dfb commit a913582
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/docs-using-js-api-support.md
Original file line number Diff line number Diff line change
@@ -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`.

1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a913582

Please sign in to comment.