as soon as; right after ~
Nari marks an immediate succession, meaning 'as soon as' or 'right after' an action or event.
This pattern expresses that the second action or state occurs immediately after the first, often with a sense of suddenness or inevitability. It is a written, formal construction, frequently found in literary works, news reports, or narrative prose. In conversation, you'll rarely hear it; people would use ~たとたん or ~しだい instead.
The nuance is that the second event follows without any pause, and often the first event triggers the second. For example, 家に帰るなり、叫び出した means 'the moment I got home, I started screaming.' Because it's formal, it can sound dramatic or literary.
Be careful with the placement: it attaches directly to the verb's dictionary form, but not to the ます-stem or て-form. Also, note that the subject of the two clauses can be the same or different, but the pattern emphasizes the quick succession.