Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chances/node-webidl
Bindings generator for Node Addons given WebIDL documents
https://github.com/chances/node-webidl
node-addons node-webidl webidl
Last synced: about 2 months ago
JSON representation
Bindings generator for Node Addons given WebIDL documents
- Host: GitHub
- URL: https://github.com/chances/node-webidl
- Owner: chances
- License: bsd-3-clause
- Created: 2020-01-24T00:13:07.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T23:39:42.000Z (almost 3 years ago)
- Last Synced: 2024-10-29T00:57:16.993Z (2 months ago)
- Topics: node-addons, node-webidl, webidl
- Language: TypeScript
- Homepage:
- Size: 277 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Node WebIDL
[![NPM Version][npm-image]][npm-url] [![Build Status][ci-image]][ci-url] [![NPM Dependencies][deps-image]][deps-url] ![Maintenance Status][maintain-image]
Bindings generator for Node Addons given a WebIDL document.
## Installation
```sh
$ npm install --global node-webidl
```## Usage
Generate a Node Addon binding given a C header and annotated Web IDL.
```sh
$ webidl-bind [options] [files]
```### Options
| | |
| -------------------------- | --- |
| `-V, --version` | print the version number |
| `-o, --out-file ` | redirect generated output to a file |
| `-h, --help` | print usage information |### Binding to C
Given a C source implementation file, e.g. `add.h`:
```c
float addition(float x, float y) {
return x + y;
}
```Write a Web IDL interface describing how to interop with Node, e.g. `add.webidl`:
```webidl
[Bind="add.h"]
interface Add {
[Bind="addition"]
float add(float x, float y);
};
```Generate bindings:
```sh
$ webidl-bind -o add.c add.webidl
```## License
[BSD-3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
Copyright © 2020 Chance Snow. All rights reserved.
[npm-url]: https://npmjs.org/package/node-webidl
[npm-image]: https://badge.fury.io/js/node-webidl.svg
[ci-url]: https://github.com/chances/node-webidl/actions
[ci-image]: https://img.shields.io/github/workflow/status/chances/node-webidl/Node%20WebIDL%20CI/master?logo=github
[deps-url]: https://david-dm.org/chances/node-webidl
[deps-image]: https://img.shields.io/david/chances/node-webidl.svg
[deps-dev-url]: https://david-dm.org/chances/node-webidl#info=devDependencies
[deps-dev-image]: https://img.shields.io/david/dev/chances/node-webidl.svg
[maintain-image]: https://img.shields.io/maintenance/yes/2020.svg