Create Title from Question using Compromise Javascript?

I want to know if it is possible to create a title from a question that was inputted by the user using compromise package in my react app. In chatgpt, they are doing it using the open AI API so when a user asks a question no matter how long is it; it creates him a meaningful title which is displayed in the sidebar. I want to see if it is also possible to do it use compromise.

So for example in the promptbar the user writes the following: I am trying to create react application using next.js. Can you show me how to create it ?

Something meaningful from it could be: Create react app using Next.js

This is just an idea of what I am looking for using compromise.

Is that possible ? If yes how can I do it ? If it is not possible, how can I do it without using open ai API ?