Turning a node into component

Is to possible to create a component from an existing node.

I know there is an API figma.createComponent(), but with it I want to manually copy all the elements in to it.

It would be better to have an API that just converts a node into component.