in the same way as; in the way; as~
Expresses doing something exactly as specified by a preceding expression, meaning 'in the same way as' or 'as ~'.
This pattern indicates that an action or situation matches a previously mentioned standard, instruction, or example. It is often used when someone follows directions, imitates a model, or confirms that something happened as expected. The noun とおり literally means 'route' or 'way', but here it functions as a suffix meaning 'the same way'.
When the preceding clause is in the present tense (dictionary form), it often describes a habitual action or a general instruction. When in the past tense (plain past form), it often refers to a specific event that has already occurred. With a noun plus の, it points to a particular source like a manual, map, or promise.
This pattern is common in both speaking and writing, but in casual conversation, you might hear とおり (without に) when the following verb is implied or in set phrases like 言うとおり. However, the full とおりに is always acceptable.