serializer for js