Convert to JS library