How to count the lines in a text node


it seems that Figma doesn’t provide any informations about separate lines rendered from their text engine.

I looked everywhere, some plugins are offering some “split text” functionnality, but from what i saw in the source code, they only spit by newline character, which doesn’t tell use anything about the newline created with wrapping.

ps : im not looking for a plugin, i want to know how to do it through the API