How to add custom attribute to categories?

Hi everyone as we have added the our custom attribute to categories in 1x using placing script in root, so is there is any way to add attribute to categories in 2x.

How to add an attribute to an EAV entity type?

Examples: