Skip to content

Add String::New for std::string_view #1703

Description

@cacharle

It would be nice to have a string "constructor" which takes a string_view

Could be as simple as:

Napi::String::New(napi_env env, std::string_view value)
{
    return Napi::String::New(env, value.data(), value.size());
}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions