Preheat oven to 180 degrees Celcius or 350 degrees Fahrenheit, and line 2 baking sheets with parchment paper.
In a medium bowl, whisk together flour, cocoa, baking powder, salt and instant espresso powder, if using. Set aside.
Place dark chocolate and melted butter into a small saucepan and melt over a very low flame, or over a double boiler till smooth. Alternatively, heat in microwave in 30-second intervals until melted, stirring in between. Let mixture cool slightly.
Beat the eggs, sugars (see note if you don't have brown sugar) and vanilla in a large bowl, till light in colour and doubled (if not trippled in volume). If you lift the beaters the mixture should form a ribbon. It takes around 10 minutes by hand, or 5 minutes using an electric or stand mixer.
Slowly pour in melted chocolate mixture and mix until combined. Fold in the flour mixture followed by the chocolate chips or chunks, and the nuts if using. The batter will be wet like brownie batter.
I like to cover and chill the dough for around 30 minutes (and start preheating here), which makes the dough easier to scoop, but you can bake immediately (note that the cookies will spread more if you do so).
If you chill the dough, scoop portions and roll into balls, then place onto your baking sheet. I do 2 tbsp sized mounds, which makes 16-18 cookies. You can also use a cookie scoop, but note that you will have larger cookies. Place cookies 6 cm (2.5 inches) apart on your prepared pans, as theys will spread.
Bake for 12 to 14 minutes or until tops are set. Immediatelysprinkle with flaked salt. Let cookies cool on pan. Keep stored in an airtight container at room temperature for two days.