Skip to content

N-API version of bindings #34

Closed
Closed

Description

@drom

N-API is a new, more portable way of creating Nodejs bindings : https://nodejs.org/api/n-api.html
Does it make sense porting node-tree-sitter from NAN to NAPI ?

Activity

  1. drom commented on Mar 2, 2019

    @drom
    Author

    The main benefit of NAPI is no need for parser recompilation when running on node 6, 8, 10, 11+
    I have to use Node 8 everywhere because Atom using Node 8, and I want to use parser inside and outside of the Atom.

  2. qarlosalberto commented on May 17, 2020

    @qarlosalberto

    I have the same problems in Visual Studio Code. It's really tedious use it in vscode :(

  3. MichaelBelousov commented on Mar 6, 2022

    @MichaelBelousov

    there is apparently a napi branch in this repo which I was able to build but I am using the query API which seems to have been added after. I will reply again if I add NAPI bindings for the query API in a fork

    EDIT: it's not done but here in case it helps anyone: https://github.com/michaelBelousov/node-tree-sitter/tree/napi-with-query-api

  4. MichaelBelousov commented on Mar 8, 2022

    @MichaelBelousov

    can confirm my fork works for my parser and query API usage, and I've made a format for NAPI-compiled languages to be unwrapped and tested with a tiny alternate NAPI-bindings for tree-sitter-sql.

    This works very well for me when developing a visual studio code extension. I use prebuildify to build against electron and (I haven't tried cross-compiling yet) for multiple platforms. If someone else needs this, I can put the work into a pull request targeting the napi branch in this repository. My fork merged the tip of master as well so it is a more up-to-date version of the napi branch here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions