Changelog
napi-derive

napi-derive

napi-derive@2.10.0

1/24/2023

Highlights

ThreadsafeFunction as params and object fields

#[napi]
pub fn accept_callback(callback: ThreadsafeFunction<u32>) {
  std::thread::spawn(move || {
    callback.call(200);
  });
}

⬇️⬇️⬇️⬇️⬇️

export function acceptCallback(callback: (err: Error | null, value: number) -> any)

Disable ToNapiValue for Object

With the object_to_js = false filed, the ThreadsafeFunction could be set as an Object field.

#[napi(object, object_to_js = false)]
pub struct Options {
  pub enable_jsx: bool,
  pub on_data: ThreadsafeFunction<Vec<u8>>,
}

What's Changed

Full Changelog: https://github.com/napi-rs/napi-rs/compare/@napi-rs/cli@2.14.4...napi-derive@2.10.0

napi-derive@2.9.5

1/14/2023

What's Changed

Full Changelog: https://github.com/napi-rs/napi-rs/compare/@napi-rs/cli@2.14.3...napi-derive@2.9.5

napi-derive@2.9.4

1/13/2023

What's Changed

Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi@2.10.6...napi-derive@2.9.4

napi-derive@2.9.3

12/9/2022

What's Changed

Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.9.2...napi-derive@2.9.3

napi-derive@2.9.1

9/8/2022

What's Changed

New Contributors

Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi@2.9.0...napi-derive@2.9.1

napi-derive@2.9.0

8/23/2022

What's Changed

New Contributors

Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.8.0...napi-derive@2.9.0

napi-derive@2.8.0

8/17/2022

What's Changed

Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.7.0...napi-derive@2.8.0

napi-derive@2.7.0

8/7/2022

What's Changed

napi-derive@2.6.0

7/6/2022

What's Changed

Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.5.0...napi-derive@2.6.0

napi-derive@2.5.0

6/10/2022

What's Changed

Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.4.1...napi-derive@2.5.0

napi-derive@2.3.3

4/27/2022

What's Changed

Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.3.2...napi-derive@2.3.3

napi-derive@2.3.2

4/27/2022

What's Changed

Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.3.1...napi-derive@2.3.2

napi-derive@2.3.1

4/25/2022

What's Changed

New Contributors

Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi@2.3.1...napi-derive@2.3.1

napi-derive@2.1.0

2/9/2022

What's Changed

New Contributors

Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.0.8...napi-derive@2.1.0

napi-derive@2.0.8

1/18/2022

What's Changed

Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.0.7...napi-derive@2.0.8

napi-derive@2.0.7

1/7/2022

What's Changed

Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.0.6...napi-derive@2.0.7

napi-derive@2.0.6

1/6/2022

What's Changed

Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.0.5...napi-derive@2.0.6

napi-derive@2.0.5

1/4/2022

What's Changed

Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.0.4...napi-derive@2.0.5