Cut the asparagus in large pieces and place them in a large pot. Add just enough water to barely cover and bring to a boil over high heat.
Reduce the heat to medium, cover, and boil the asparagus gently until they are fork-tender, about 10 minutes for slender asparagus, longer for thick ones. Reserving the cooking water, drain the asparagus.
Place the asparagus in a food processor along with 1/4 cup of the reserved cooking water and the garlic. Add the pine nuts, if using, the oil, lemon juice, and salt to taste and pulse to combine. If necessary, add a bit more cooking water to get a smooth pesto.
The asparagus pesto holds in the freezer for 8 to 12 months. Add salt and pepper as you use the pesto (seasoning loses its oomph when frozen).