Ionic v2 Custom plugin

I’m want to create a ionic component to reuse in different projects. My idea is to create a custom ionic plugin (not cordova plugin) and then import it in all my projects! (maybe through npm). Im able to create my own component, but i dont know how to create my custom plugin. Are there some guidelines or any suggestion/idea to achieve that?
Thank you

This exists:

Thank you very much :grinning: