How to retrieve files with same extension


I know there is atom.workspace.scan. But the problem is it tries to search files with the specified regex. That regex can be in any files
I just wanted for example files with all .txt extension to be returned. Is there any API available in atom for doing this.


Just ignore this I found a way using atom.workspace.scan with the options parameter passing paths with the extension you are looking for. Thanks