#[macro_use]
      extern crate napi_derive;
      use std::convert::TryInto;
      use napi::{CallContext, JsNumber, JsObject, JsUndefined, JsString, Property, Result};
      
      #[js_function(1)]
      fn class_constructor(ctx: CallContext) -> Result<JsUndefined> {
        // Define class constructor
      }
      #[js_function(1)]
      fn process_data_class(ctx: CallContext) -> Result<JsObject> {
      	// Define class methods
      }
      #[module_exports]
      pub fn init(mut exports: JsObject) -> Result<()> {
        exports.create_named_method($1, process_data_class)?;
        Ok(())
      }
      
      Rust language logo

      Node.js class addon

      0

      2

      avatar
      Giovanny Gongora
      Codiga's Rust Recipes

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.