nodejs / nodejs/node-addon-api
Migration from NAN to object_wrap / determine invoked property name
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.4k
- Forks
- 499
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 2
Description
This is a usage / migration from NAN question. With NAN I used the following to determine the invoked property name:
NAN_GETTER(ClassName::Getters)
{
...
std::string propertyName = *Nan::Utf8String(property);
...
}
This helped me to reduce C++ boilerplate code for classes with many properties because I did not have to declare and define every single setter and getter method in C++.
Is this still possible?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue mentions NAN getters and object_wrap but names no files or tests. Start by reviewing the node-addon-api migration guidance and the object_wrap accessor APIs, then compare them with the shown NAN pattern. Done means documenting whether the invoked property name can be obtained and giving a supported migration path or stating the limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, nodejs
- Domain
- api, developer-experience
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100