How to get list of all ERC721 holders?

Hi,

I am trying to get a list of all holders of a ERC721 Token either in JS or in Solidity. Is there any efficient script to get that info?

use the moralis nft api, it is very easy to use