feat(napi): re-export tokio and features

This commit is contained in:
LongYinan 2022-01-23 18:43:37 +08:00
parent 16f808276d
commit 13533d1a37
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7
5 changed files with 43 additions and 15 deletions
examples/napi

View file

@ -10,12 +10,11 @@ crate-type = ["cdylib"]
[dependencies]
futures = "0.3"
napi = {path = "../../crates/napi", default-features = false, features = ["napi8", "tokio_rt", "serde-json", "async", "experimental", "latin1"]}
napi = {path = "../../crates/napi", default-features = false, features = ["tokio_fs", "napi8", "tokio_rt", "serde-json", "async", "experimental", "latin1"]}
napi-derive = {path = "../../crates/macro", features = ["type-def"]}
serde = "1"
serde_derive = "1"
serde_json = "1"
tokio = {version = "1", features = ["default", "fs"]}
[build-dependencies]
napi-build = {path = "../../crates/build"}

View file

@ -1,6 +1,6 @@
use futures::prelude::*;
use napi::bindgen_prelude::*;
use tokio::fs;
use napi::tokio::{self, fs};
#[napi]
async fn read_file_async(path: String) -> Result<Buffer> {