Skip to content

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

@cacharle

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());
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Need Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions