{
"repo": "libjstl",
"timestamp": "2026-01-16T23:56:24.954Z",
"entryPoint": "index.js",
"exports": {
"packageJson": {}
},
"api": {},
"readme": {
"content": "# libjstl\n\nC++ template library for <https://github.com/holepunchto/libjs>. It aims to make interacting with the low-level API safer and more efficient without making callers feel too much like they're writing C++.\n\n## API\n\n### Handle types\n\nTo improve type safety and ergonomics `libjstl` wraps the `js_value_t *` ABI handle type in a type hierarchy that mirrors the JavaScript type hierarchy. All handle types support conversion to plain `js_value_t *` ABI handles by means of explicit casts:\n\n```cpp\njs_boolean_t boolean;\n\njs_value_t *handle = static_cast<js_value_t *>(boolean);\n```\n\nFor cases where an ABI handle output variable is expected, cast to `js_value_t **` instead:\n\n```cpp\njs_boolean_t boolean;\n\njs_value_t **handle = static_cast<js_value_t **>(boolean);\n```\n\n#### `js_handle_t`\n\n#### `js_primitive_t`\n\n#### `js_boolean_t`\n\n#### `js_numeric_t`\n\n#### `js_number_t`\n\n#### `js_integer_t`\n\n#### `js_bigint_t`\n\n#### `js_name_t`\n\n#### `js_string_t`\n\n#### `js_symbol_t`\n\n#### `js_object_t`\n\n#",
"sections": [
"intro",
"api",
"license"
],
"hasApi": true,
"hasExamples": true,
"exampleCount": 6,
"examples": [
"For cases where an ABI handle output variable is expected, cast to `js_value_t **` instead:",
"#### `js_handle_t`\n\n#### `js_primitive_t`\n\n#### `js_boolean_t`\n\n#### `js_numeric_t`\n\n#### `js_number_t`\n\n#### `js_integer_t`\n\n#### `js_bigint_t`\n\n#### `js_name_t`\n\n#### `js_string_t`\n\n#### `js_symbol_t`\n\n#### `js_object_t`\n\n#### `js_array_t`\n\n#### `js_arraybuffer_t`\n\n#### `js_typedarray_t<T>`\n\n#### `js_typedarray_t<>`\n\n#### `js_function_t<R, A...>`\n\n#### `js_external_t<T>`\n\n### Type marshalling\n\nAt the core of `libjstl` is a type marshalling system responsible for converting between ABI types, such as `js_value_t *` handles, and native C/C++ types. Type marshalling is accessed through `js_type_info_t<T>` which describes the type `T` and implements the marshalling and unmarshalling methods responsible for converting `T` to and from its associated ABI type.\n\n#### `js_type_info_t<T>`",
"##### `js_type_info_t<T>::type`\n\nThe ABI type used to represent `T`. Must be `js_value_t *` unless otherwise stated."
]
},
"patterns": []
}