extract-selection package
Extracts the selected text into a let or const statement. You can change how the new let/const statement will end (semicolon, space+semicolon, or nothing) in the package settings.
Original repo
Thanks to David Bazile for the original repo, of which this is a fork. https://github.com/dbazile/extract-selection